351-0014-brcmfmac-use-ndev-needed_headroom-to-reserve-additio.patch 1.3 KB

123456789101112131415161718192021222324252627282930
  1. From: Wright Feng <wright.feng@broadcom.com>
  2. Date: Fri, 3 Jun 2016 23:31:09 +0200
  3. Subject: [PATCH] brcmfmac: use ndev->needed_headroom to reserve additional
  4. header space
  5. When using nmap tool with FMAC, the nmap packets were be dropped by kernel
  6. because the size was too short. The kernel message showed like
  7. "nmap: packet size is too short (42 <= 50)". It is caused by the packet
  8. length is shorter than ndev->hard_header_len. According to definition of
  9. LL_RESERVED_SPACE() and hard_header_len, we should use hard_header_len
  10. to reserve for L2 header, like ethernet header(ETH_HLEN) in our case and
  11. use needed_headroom for the additional headroom needed by hardware.
  12. Reviewed-by: Arend Van Spriel <arend@broadcom.com>
  13. Signed-off-by: Wright Feng <wright.feng@broadcom.com>
  14. Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
  15. Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
  16. ---
  17. --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
  18. +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
  19. @@ -516,7 +516,7 @@ int brcmf_net_attach(struct brcmf_if *if
  20. /* set appropriate operations */
  21. ndev->netdev_ops = &brcmf_netdev_ops_pri;
  22. - ndev->hard_header_len += drvr->hdrlen;
  23. + ndev->needed_headroom += drvr->hdrlen;
  24. ndev->ethtool_ops = &brcmf_ethtool_ops;
  25. drvr->rxsz = ndev->mtu + ndev->hard_header_len +