1. 14 Dec, 2017 7 commits
    • Sven Eckelmann's avatar
      ath10k: search DT for qcom,ath10k-calibration-variant · d06f26c5
      Sven Eckelmann authored
      Board Data File (BDF) is loaded upon driver boot-up procedure. The right
      board data file is identified on QCA4019 using bus, bmi-chip-id and
      bmi-board-id.
      
      The problem, however, can occur when the (default) board data file cannot
      fulfill with the vendor requirements and it is necessary to use a different
      board data file.
      
      This problem was solved for SMBIOS by adding a special SMBIOS type 0xF8.
      Something similar has to be provided for systems without SMBIOS but with
      device trees. No solution was specified by QCA and therefore a new one has
      to be found for ath10k.
      
      The device tree requires addition strings to define the variant name
      
          wifi@a000000 {
          	status = "okay";
          	qcom,ath10k-calibration-variant = "RT-AC58U";
          };
      
          wifi@a800000 {
          	status = "okay";
          	qcom,ath10k-calibration-variant = "RT-AC58U";
          };
      
      This would create the boarddata identifiers for the board-2.bin search
      
       *  bus=ahb,bmi-chip-id=0,bmi-board-id=16,variant=RT-AC58U
       *  bus=ahb,bmi-chip-id=0,bmi-board-id=17,variant=RT-AC58U
      Signed-off-by: default avatarSven Eckelmann <sven.eckelmann@openmesh.com>
      Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
      d06f26c5
    • Sven Eckelmann's avatar
      dt: bindings: add new dt entry for ath10k calibration variant · 40fb0eab
      Sven Eckelmann authored
      The bus + bmi-chip-id + bmi-board-id is not enough to identify the correct
      board data file on QCA4019 based devices. Multiple different boards share
      the same values. Only the original reference designs can currently be
      identified and loaded from the board-2.bin. But these will not result in
      the correct calibration data when combined with the pre-calibration data
      from the device.
      
      An additional "variant" information has to be provided (via SMBIOS or DT)
      to select the correct board data for a design which was modified by an ODM.
      Signed-off-by: default avatarSven Eckelmann <sven.eckelmann@openmesh.com>
      Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
      40fb0eab
    • Anilkumar Kolli's avatar
      ath10k: add per peer tx stats support for 10.2.4 · e8123bb7
      Anilkumar Kolli authored
      10.2.4 firmware branch (used in QCA988X) does not support
      HTT_10_4_T2H_MSG_TYPE_PEER_STATS and that's why ath10k does not provide
      tranmission rate statistics to user space, instead it just shows
      hardcoded 6 Mbit/s. But pktlog firmware facility provides per peer tx
      statistics. The firmware sends one pktlog event for every four
      PPDUs per peer, which include:
      
      * successful number of packets and bytes transmitted
      * number of packets and bytes dropped
      * retried number of packets and bytes
      * rate info per ppdu
      
      Firmware supports WMI_SERVICE_PEER_STATS, pktlog is enabled through
      ATH10K_FLAG_PEER_STATS, which is nowadays enabled by default in ath10k.
      
      This patch does not impact throughput.
      
      Tested on QCA9880 with firmware version 10.2.4.70.48. This should also
      work with firmware branch 10.2.4-1.0-00029
      
      Parse peer stats from pktlog packets and update the tx rate information
      per STA. This way user space can query about transmit rate with iw:
      
      $iw wlan0 station dump
      Station 3c:a9:f4:72:bb:a4 (on wlan1)
              inactive time:  8210 ms
              rx bytes:       9166
              rx packets:     44
              tx bytes:       1105
              tx packets:     9
              tx retries:     0
              tx failed:      1
              rx drop misc:   3
              signal:         -75 [-75, -87, -88] dBm
              signal avg:     -75 [-75, -85, -88] dBm
              tx bitrate:     39.0 MBit/s MCS 10
              rx bitrate:     26.0 MBit/s MCS 3
              rx duration:    23250 us
              authorized:     yes
              authenticated:  yes
              associated:     yes
              preamble:       short
              WMM/WME:        yes
              MFP:            no
              TDLS peer:      no
              DTIM period:    2
              beacon interval:100
              short preamble: yes
              short slot time:yes
              connected time: 22 seconds
      Signed-off-by: default avatarAnilkumar Kolli <akolli@qti.qualcomm.com>
      Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
      e8123bb7
    • Anilkumar Kolli's avatar
      ath10k: move pktlog_filter out of ath10k_debug · 7f9befbb
      Anilkumar Kolli authored
      Move pktlog_filter from struct ath10k_debug to struct ath10k
      so that pktlog can be enabled even when debugfs is not
      enabled, needed to enable peer tx stats for 10.2.4.
      
      No changes in functionality.
      Signed-off-by: default avatarAnilkumar Kolli <akolli@qti.qualcomm.com>
      Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
      7f9befbb
    • Anilkumar Kolli's avatar
      ath10k: remove MAC80211_DEBUGFS dependency on ath10k_sta_statistics · 6a7f8911
      Anilkumar Kolli authored
      Remove CONFIG_MAC80211_DEBUGFS dependency on ath10k_sta_statistics().
      ath10k_sta_statistics() has per sta tx/rx stats and this should not
      be dependent on MAC80211_DEBUGFS.
      
      No changes in functionality.
      Signed-off-by: default avatarAnilkumar Kolli <akolli@qti.qualcomm.com>
      Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
      6a7f8911
    • Rajkumar Manoharan's avatar
      ath10k: unify rx processing in napi_poll · deba1b9e
      Rajkumar Manoharan authored
      With current NAPI implementation, NAPI poll can deliver more frames
      to net core than allotted budget. This may cause warning in napi_poll.
      Remaining quota is not accounted, while processing amsdus in
      rx_in_ord_ind and rx_ind queue. Adding num_msdus at last can not
      prevent delivering more frames to net core. With this change,
      all amdus from both in_ord_ind and rx_ind queues are processed and
      enqueued into common skb list instead of delivering into mac80211.
      Later msdus from common queue are dequeued and delivered depends on
      quota availability. This change also simplifies the rx processing in
      napi poll routine.
      Signed-off-by: default avatarRajkumar Manoharan <rmanohar@qti.qualcomm.com>
      Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
      deba1b9e
    • Balaji Pothunoori's avatar
      ath10k: handling qos at STA side based on AP WMM enable/disable · 07ffb449
      Balaji Pothunoori authored
      Data packets are not sent by STA in case of STA joined to
      non QOS AP (WMM disabled AP). This is happening because of STA
      is sending data packets to firmware from host with qos enabled
      along with non qos queue value(TID = 16).
      Due to qos enabled, firmware is discarding the packet.
      
      This patch fixes this issue by updating the qos based on station
      WME capability field if WMM is disabled in AP.
      
      This patch is required by 10.4 family chipsets like
      QCA4019/QCA9888/QCA9884/QCA99X0.
      Firmware Versoin : 10.4-3.5.1-00018.
      
      For 10.2.4 family chipsets QCA988X/QCA9887 and QCA6174 this patch
      has no effect.
      Signed-off-by: default avatarBalaji Pothunoori <bpothuno@qti.qualcomm.com>
      Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
      07ffb449
  2. 07 Dec, 2017 6 commits
  3. 02 Dec, 2017 17 commits
  4. 30 Nov, 2017 10 commits
    • Linus Walleij's avatar
      Documentation: net: dsa: Cut set_addr() documentation · 0fc66ddf
      Linus Walleij authored
      This is not supported anymore, devices needing a MAC address
      just assign one at random, it's just a driver pecularity.
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0fc66ddf
    • David S. Miller's avatar
      Merge branch 'net-dst_entry-shrink' · 3d8068c5
      David S. Miller authored
      David Miller says:
      
      ====================
      net: Significantly shrink the size of routes.
      
      Through a combination of several things, our route structures are
      larger than they need to be.
      
      Mostly this stems from having members in dst_entry which are only used
      by one class of routes.  So the majority of the work in this series is
      about "un-commoning" these members and pushing them into the type
      specific structures.
      
      Unfortunately, IPSEC needed the most surgery.  The majority of the
      changes here had to do with bundle creation and management.
      
      The other issue is the refcount alignment in dst_entry.  Once we get
      rid of the not-so-common members, it really opens the door to removing
      that alignment entirely.
      
      I think the new layout looks really nice, so I'll reproduce it here:
      
      	struct net_device       *dev;
      	struct  dst_ops	        *ops;
      	unsigned long		_metrics;
      	unsigned long           expires;
      	struct xfrm_state	*xfrm;
      	int			(*input)(struct sk_buff *);
      	int			(*output)(struct net *net, struct sock *sk, struct sk_buff *skb);
      	unsigned short		flags;
      	short			obsolete;
      	unsigned short		header_len;
      	unsigned short		trailer_len;
      	atomic_t		__refcnt;
      	int			__use;
      	unsigned long		lastuse;
      	struct lwtunnel_state   *lwtstate;
      	struct rcu_head		rcu_head;
      	short			error;
      	short			__pad;
      	__u32			tclassid;
      
      (This is for 64-bit, on 32-bit the __refcnt comes at the very end)
      
      So, the good news:
      
      1) struct dst_entry shrinks from 160 to 112 bytes.
      
      2) struct rtable shrinks from 216 to 168 bytes.
      
      3) struct rt6_info shrinks from 384 to 320 bytes.
      
      Enjoy.
      
      v2:
      	Collapse some patches logically based upon feedback.
      	Fix the strange patch #7.
      
      v3:	xfrm_dst_path() needs inline keyword
      	Properly align __refcnt on 32-bit.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3d8068c5
    • David Miller's avatar
      net: Remove dst->next · 7149f813
      David Miller authored
      There are no more users.
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Reviewed-by: default avatarEric Dumazet <edumazet@google.com>
      7149f813
    • David Miller's avatar
      xfrm: Stop using dst->next in bundle construction. · 5492093d
      David Miller authored
      While building ipsec bundles, blocks of xfrm dsts are linked together
      using dst->next from bottom to the top.
      
      The only thing this is used for is initializing the pmtu values of the
      xfrm stack, and for updating the mtu values at xfrm_bundle_ok() time.
      
      The bundle pmtu entries must be processed in this order so that pmtu
      values lower in the stack of routes can propagate up to the higher
      ones.
      
      Avoid using dst->next by simply maintaining an array of dst pointers
      as we already do for the xfrm_state objects when building the bundle.
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Reviewed-by: default avatarEric Dumazet <edumazet@google.com>
      5492093d
    • David Miller's avatar
      net: Rearrange dst_entry layout to avoid useless padding. · 8b207e73
      David Miller authored
      We have padding to try and align the refcount on a separate cache
      line.  But after several simplifications the padding has increased
      substantially.
      
      So now it's easy to change the layout to get rid of the padding
      entirely.
      
      We group the write-heavy __refcnt and __use with less often used
      items such as the rcu_head and the error code.
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Reviewed-by: default avatarEric Dumazet <edumazet@google.com>
      8b207e73
    • David Miller's avatar
      xfrm: Move dst->path into struct xfrm_dst · 0f6c480f
      David Miller authored
      The first member of an IPSEC route bundle chain sets it's dst->path to
      the underlying ipv4/ipv6 route that carries the bundle.
      
      Stated another way, if one were to follow the xfrm_dst->child chain of
      the bundle, the final non-NULL pointer would be the path and point to
      either an ipv4 or an ipv6 route.
      
      This is largely used to make sure that PMTU events propagate down to
      the correct ipv4 or ipv6 route.
      
      When we don't have the top of an IPSEC bundle 'dst->path == dst'.
      
      Move it down into xfrm_dst and key off of dst->xfrm.
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Reviewed-by: default avatarEric Dumazet <edumazet@google.com>
      0f6c480f
    • David Miller's avatar
      ipv6: Move dst->from into struct rt6_info. · 3a2232e9
      David Miller authored
      The dst->from value is only used by ipv6 routes to track where
      a route "came from".
      
      Any time we clone or copy a core ipv6 route in the ipv6 routing
      tables, we have the copy/clone's ->from point to the base route.
      
      This is used to handle route expiration properly.
      
      Only ipv6 uses this mechanism, and only ipv6 code references
      it.  So it is safe to move it into rt6_info.
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Reviewed-by: default avatarEric Dumazet <edumazet@google.com>
      3a2232e9
    • David Miller's avatar
      xfrm: Move child route linkage into xfrm_dst. · b6ca8bd5
      David Miller authored
      XFRM bundle child chains look like this:
      
      	xdst1 --> xdst2 --> xdst3 --> path_dst
      
      All of xdstN are xfrm_dst objects and xdst->u.dst.xfrm is non-NULL.
      The final child pointer in the chain, here called 'path_dst', is some
      other kind of route such as an ipv4 or ipv6 one.
      
      The xfrm output path pops routes, one at a time, via the child
      pointer, until we hit one which has a dst->xfrm pointer which
      is NULL.
      
      We can easily preserve the above mechanisms with child sitting
      only in the xfrm_dst structure.  All children in the chain
      before we break out of the xfrm_output() loop have dst->xfrm
      non-NULL and are therefore xfrm_dst objects.
      
      Since we break out of the loop when we find dst->xfrm NULL, we
      will not try to dereference 'dst' as if it were an xfrm_dst.
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b6ca8bd5
    • David Miller's avatar
      ipsec: Create and use new helpers for dst child access. · 45b018be
      David Miller authored
      This will make a future change moving the dst->child pointer less
      invasive.
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Reviewed-by: default avatarEric Dumazet <edumazet@google.com>
      45b018be
    • David Miller's avatar
      net: Create and use new helper xfrm_dst_child(). · b92cf4aa
      David Miller authored
      Only IPSEC routes have a non-NULL dst->child pointer.  And IPSEC
      routes are identified by a non-NULL dst->xfrm pointer.
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b92cf4aa