06 Jul, 2016

9 commits

  • The Digital Protocol stack used to send a NACK frame whatever the error
    type it receives in digital_in_recv_dep_res(). It actually should only
    send a NACK frame on CRC or parity check errors or on any transmission
    error if a NACK frame was previously sent. Existing drivers used to send
    EIO error for this kind of issues so this patch limits sending of NACK
    frames on EIO errors. All other errors will be reported to the upper
    layers.

    Signed-off-by: Thierry Escande
    Signed-off-by: Samuel Ortiz

    Thierry Escande
     
  • When configured as a target listening for a SENSF_REQ poll command, a
    nfcid2 array was allocated for no reason leading to a memory leak. The
    nfcid2 is sent by the target in the SENSF_RES reply.

    Signed-off-by: Thierry Escande
    Signed-off-by: Samuel Ortiz

    Thierry Escande
     
  • The nfcsim driver now depends on the Digital layer. This patch adds the
    missing dependency on NFC_DIGITAL for NFC_SIM config.

    Signed-off-by: Thierry Escande
    Signed-off-by: Samuel Ortiz

    Thierry Escande
     
  • If a command is still being processed by the device, the switch RF off
    command will be rejected. With this patch, the port100 driver calls
    port100_abort_cmd() before sending the switch RF off command.

    Signed-off-by: Thierry Escande
    Signed-off-by: Samuel Ortiz

    Thierry Escande
     
  • This patch makes the abort_cmd function synchronous. This allows the
    caller to immediately send a new command after abort_cmd() returns.

    Signed-off-by: Thierry Escande
    Signed-off-by: Samuel Ortiz

    Thierry Escande
     
  • The USB out_urb used to send commands to the device can be submitted
    through the standard command processing queue coming from the Digital
    Protocol layer but it can also be submitted from port100_abort_cmd().

    To not submit the URB while already active, a mutex is now used to
    protect it and a cmd_cancel flag is used to not send command while
    canceling the previous one.

    Signed-off-by: Thierry Escande
    Signed-off-by: Samuel Ortiz

    Thierry Escande
     
  • This patch ensures that a command is not still in process before sending
    a new one to the device. This can happen when neard is in constant
    polling mode: the configure_hw command can be sent when neard restarts
    polling after a LLCP SYMM timeout but before the device has returned in
    timeout from the last DEP frame sent.

    Signed-off-by: Thierry Escande
    Signed-off-by: Samuel Ortiz

    Thierry Escande
     
  • Once copied into the sk_buff data area using llcp_add_tlv(), the
    allocated TLVs must be freed.

    With this patch nfc_llcp_send_connect() and nfc_llcp_send_cc() don't
    return immediately on success and now free the allocated TLVs.

    Signed-off-by: Thierry Escande
    Signed-off-by: Samuel Ortiz

    Thierry Escande
     
  • In functions using llcp_add_tlv(), a skb pointer could be set to NULL
    and then reuse afterward.

    With this patch, the skb pointer returned by llcp_add_tlv() is ignored
    since it can only be the passed skb pointer or NULL when the passed TLV
    is NULL. There is also no need to check for the TLV pointer as this is
    done by llcp_add_tlv().

    Signed-off-by: Thierry Escande
    Signed-off-by: Samuel Ortiz

    Thierry Escande
     

04 Jul, 2016

9 commits

  • With this complete rewrite, the loopback nfcsim driver now relies on the
    Digital layer of the nfc stack. As with the previous version, 2 nfc
    devices are declared when the driver is initialized. The driver supports
    the NFC_DEP protocol in NFC-A and NFC-F technologies.

    The 2 devices are using a pair of virtual links for sk_buff exchange.
    The out-link of one device is the in-link of the other and conversely.

    To receive data, a device calls nfcsim_link_recv_skb() on its in-link
    and waits for incoming data on a wait queue. To send data, a device
    calls nfcsim_link_send_skb() on its out-link which stores the passed skb
    and signals its wait queue. If the peer device was in the
    nfcsim_link_recv_skb() call, it will be signaled and will be able to
    pass the received sk_buff up to the Digital layer.

    Signed-off-by: Thierry Escande
    Signed-off-by: Samuel Ortiz

    Thierry Escande
     
  • LLCP skb tx and rx functions now use print_hex_dump_debug() making
    these verbose traces controllable using dynamic debug.

    Signed-off-by: Thierry Escande
    Signed-off-by: Samuel Ortiz

    Thierry Escande
     
  • This replaces the polling work struct with a delayed work struct and add
    a 10 ms delay between 2 poll cycles. This avoids to flood the device
    with 'switch off'/'switch on' commands.

    Signed-off-by: Thierry Escande
    Signed-off-by: Samuel Ortiz

    Thierry Escande
     
  • When setting the driver framing as NFC_DIGITAL_FRAMING_NFCF_NFC_DEP it
    used to be already configured as NFC_DIGITAL_FRAMING_NFCF which is the
    same. So this entry was empty in the in_protocols table.
    Now that the digital stack can handle PLS requests, it can be changed
    on the fly from NFC_DIGITAL_FRAMING_NFCA_NFC_DEP.
    This patch explicitly defines the framing configuration values for
    NFC_DIGITAL_FRAMING_NFCF_NFC_DEP.

    Signed-off-by: Thierry Escande
    Signed-off-by: Samuel Ortiz

    Thierry Escande
     
  • Signed-off-by: Geoff Lansberry
    Signed-off-by: Samuel Ortiz

    Geoff Lansberry
     
  • drivers/nfc/fdp/fdp.c: In function ‘fdp_nci_patch_otp’:
    drivers/nfc/fdp/fdp.c:373: warning: comparison is always false due to limited range of data type
    drivers/nfc/fdp/fdp.c: In function ‘fdp_nci_patch_ram’:
    drivers/nfc/fdp/fdp.c:444: warning: comparison is always false due to limited range of data type

    fdp_nci_create_conn() may return a negative error code, which is
    silently ignored by assigning it to a u8.

    Change conn_id from u8 to int to fix this.

    Fixes: a06347c04c13e380 ("NFC: Add Intel Fields Peak NFC solution driver")
    Signed-off-by: Geert Uytterhoeven
    Signed-off-by: Samuel Ortiz

    Geert Uytterhoeven
     
  • We can't pass devm_ allocated pointers to kfree() because they will be
    freed again after the drive is unloaded.

    Signed-off-by: Dan Carpenter
    Signed-off-by: Samuel Ortiz

    Dan Carpenter
     
  • It used to be EXPORTed, but then EXPORT usage was cleaned up
    (in 2012), without noticing that the function has no users at all
    (and curiously, never had any users).

    Delete it.

    While at it, remove non-static "inline" hints on nearby functions:
    these hints don't work across compilation units anyway,
    and these functions are not used in their .c file, thus they are
    never inlined. IOW: "inline" here does not help in any way.

    Signed-off-by: Denys Vlasenko
    CC: Samuel Ortiz
    CC: Christophe Ricard
    CC: linux-wireless@vger.kernel.org
    CC: linux-kernel@vger.kernel.org
    Signed-off-by: Samuel Ortiz

    Denys Vlasenko
     
  • When info->ram_patch is released info->otp_patch is being set
    to NULL rather than info->ram_patch. I believe this is a cut-n-paste
    bug from almost identical code proceeding it that uses the same
    idiom for info->otp_patch.

    Signed-off-by: Colin Ian King
    Signed-off-by: Samuel Ortiz

    Colin Ian King
     

03 Jul, 2016

22 commits

  • commit 8067302973a1 ("net-next: mediatek: add support for IRQ grouping")
    failed to properly update the irq handling inside mtk_poll_controller()
    causing compile errors if netconsole was enabled. Fix this by updating
    the code to use the new separated irq handler function for RX.

    Signed-off-by: John Crispin
    Signed-off-by: David S. Miller

    John Crispin
     
  • Jiri Pirko says:

    ====================
    mlxsw: Lay the groundwork for the introduction of router interfaces

    This is first patchset on a way to introduce ipv4 routing offload support
    in mlxsw driver. Does preparations before router interfaces will
    be introduced in mlxsw.
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     
  • ip2me:
    To instruct HW to send trapped ip2me traffic to kernel, we have to add
    this trap. Selection ip2me traffic is introduced later on in this set.

    ARPs:
    We are going to stop flooding to CPU port when netdev isn't bridged and
    only get packets destined to the netdev's IP address and certain control
    packets.

    Add traps for ARP request (broadcast) and response (unicast) in order to
    get these to the CPU and resolve neighbours.

    host miss:
    If a packet is routed through a directly connected route and its
    destination IP is not in the device's neighbour table, then we need to
    trap it to CPU. This will cause the host to resolve the MAC of the
    neighbour, which will be eventually programmed to the device's table.

    router ingress:
    In order to trap packets in router part.

    Signed-off-by: Ido Schimmel
    Signed-off-by: Jiri Pirko
    Signed-off-by: David S. Miller

    Jiri Pirko
     
  • When removing packet traps we should use action 'discard' instead of
    'forward', as some trap IDs we'll add cannot be configured with the
    later. However, result is the same, as packets are not trapped to the
    CPU.

    In the future we will be able to reverse the operation properly by
    detaching the trap group from the CPU.

    Signed-off-by: Ido Schimmel
    Signed-off-by: Jiri Pirko
    Signed-off-by: David S. Miller

    Ido Schimmel
     
  • Add the Router Interface Table Register (RITR), which allows us to
    create and configure router interfaces (RIFs).

    Signed-off-by: Ido Schimmel
    Signed-off-by: Jiri Pirko
    Signed-off-by: David S. Miller

    Ido Schimmel
     
  • Incoming packets are directed to the router when they match an FDB
    entry with action forward to IP router.

    Add this action, which was mistakenly named "TRAP".

    Signed-off-by: Ido Schimmel
    Signed-off-by: Jiri Pirko
    Signed-off-by: David S. Miller

    Ido Schimmel
     
  • When enabling the router in the device we will represent L3 netdevs
    using router interfaces (RIFs). These will be specified whenever
    programming routes or neighbours on the netdev.

    Introduce the basic RIF infrastructure which allows one to lookup a RIF
    by its netdev. Later patches in the series will extend this, but the
    basic routines are needed now in order to direct traffic to CPU.

    Pointers to the RIF structs are stored in an array indexed by the RIF's
    number. This will allow us to efficiently update the kernel's neighbour
    table when regularly dumping the device's table.

    Signed-off-by: Ido Schimmel
    Signed-off-by: Jiri Pirko
    Signed-off-by: David S. Miller

    Ido Schimmel
     
  • Create a skeleton router file and do basic HW initialization of router.

    Signed-off-by: Ido Schimmel
    Signed-off-by: Jiri Pirko
    Signed-off-by: David S. Miller

    Ido Schimmel
     
  • During ports initialization a net device is registered for each
    available port, which implies the port is usable. However, a port is
    only usable after the different parts of the device (e.g. flooding,
    buffers) are initialized. This is especially important now, when we must
    initialize the router before the ports, as otherwise the device can't be
    initialized.

    Solve that by initializing the switch ports at the end of init sequence.

    Also, remove an unnecessary warning about port up/down events, which
    would otherwise be invoked whenever removing the driver, as ports are
    removed before unregistering the listener for these events.

    Signed-off-by: Ido Schimmel
    Signed-off-by: Jiri Pirko
    Signed-off-by: David S. Miller

    Ido Schimmel
     
  • Add the Router General Configuration Register (RGCR), which allows us to
    enable the router in the device and configure its various parameters.

    Signed-off-by: Ido Schimmel
    Signed-off-by: Jiri Pirko
    Signed-off-by: David S. Miller

    Ido Schimmel
     
  • We are going to assign router interfaces (RIFs) to netdevs if an IPv4
    address was assigned to them. If one was assigned to a port netdev, this
    will translate to the PVID vPort being member in a RIF.

    While it's possible for a LAG slave to have an IP address, we can't have
    a vPort being member in two FIDs (assuming the LAG device will be
    put in bridge / assigned an IP address).

    Solve that by making the PVID vPort leave any FID it might be a member
    in when joining / leaving LAG.

    Note that the PVID vPort is the only vPort that can be present on the
    port when it's put under LAG.

    Signed-off-by: Ido Schimmel
    Signed-off-by: Jiri Pirko
    Signed-off-by: David S. Miller

    Ido Schimmel
     
  • When VLAN devices are created on top of LAG, their underlying vPorts are
    configured correctly with LAG membership.

    However, the PVID vPort is implicit and already present when the port
    netdev is put under LAG, so its LAG membership is never set. Set it
    correctly when joining / leaving LAG.

    This didn't matter until now, but we are going to introduce support for
    router interfaces (RIFs), which need to take into account LAG membership.

    Signed-off-by: Ido Schimmel
    Signed-off-by: Jiri Pirko
    Signed-off-by: David S. Miller

    Ido Schimmel
     
  • When port isn't bridged it is still possible to invoke switchdev ops and
    configure the device's VLAN filters.

    However, this will require us to use different Router InterFaces (RIFs)
    for the same netdev, instead of one per-netdev as with any other
    configuration.

    Taking the above into account and the fact that this functionality is
    questionable with regards to the device's normal use-case, remove it and
    instead return an error.

    Signed-off-by: Ido Schimmel
    Signed-off-by: Jiri Pirko
    Signed-off-by: David S. Miller

    Ido Schimmel
     
  • Port netdevs (e.g. swXpY) that are not bridged are represented in the
    device using a vPort with VID=PVID=1 (the PVID vPort), as untagged
    packets entering the switch are internally tagged with the PVID VLAN.
    When these packets are routed through a different port netdev they
    should egress untagged.

    This wasn't a problem until now, as non-bridged traffic only originated
    from the CPU, which transmits packets out of the port as-is.

    When a vPort is created with VID 1 mark it as egress untagged.

    Signed-off-by: Ido Schimmel
    Signed-off-by: Jiri Pirko
    Signed-off-by: David S. Miller

    Ido Schimmel
     
  • Michael Chan says:

    ====================
    bnxt_en updates for net-next.

    Mostly small miscellaneous changes.

    Please review for net-next. Thanks.
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     
  • The allowable range is 0.25 seconds to 1 second interval. Default is
    1 second.

    Signed-off-by: Michael Chan
    Signed-off-by: David S. Miller

    Michael Chan
     
  • This is useful for multi-function devices.

    Signed-off-by: Michael Chan
    Signed-off-by: David S. Miller

    Michael Chan
     
  • With a default VLAN, the VF has its own VLAN domain and it can receive
    all traffic within that domain.

    Signed-off-by: Michael Chan
    Signed-off-by: David S. Miller

    Michael Chan
     
  • Signed-off-by: Vasundhara Volam
    Signed-off-by: Michael Chan
    Signed-off-by: David S. Miller

    Vasundhara Volam
     
  • For correctness, the MRU enables bit must be set when passing the
    MRU to firmware during vnic configuration.

    Signed-off-by: Michael Chan
    Signed-off-by: David S. Miller

    Michael Chan
     
  • Add support to the Ethtool FLASHDEV command handler for additional
    firmware types to cover all the on-chip processors.

    Signed-off-by: Rob Swindell
    Signed-off-by: Michael Chan
    Signed-off-by: David S. Miller

    Rob Swindell
     
  • Upon successful mgmt processor firmware update, request a self
    reset upon next PCIe reset (e.g. system reboot).

    Signed-off-by: Rob Swindell
    Signed-off-by: Michael Chan
    Signed-off-by: David S. Miller

    Rob Swindell