ATH10K Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: Wen Gong <wgong@codeaurora.org>
Cc: linux-wireless@vger.kernel.org, kbuild-all@01.org,
	ath10k@lists.infradead.org
Subject: Re: [PATCH] ath10k: support NET_DETECT WoWLAN feature
Date: Thu, 16 Aug 2018 05:23:04 +0800	[thread overview]
Message-ID: <201808160528.6RYbuvHS%fengguang.wu@intel.com> (raw)
In-Reply-To: <1534214568-25226-1-git-send-email-wgong@codeaurora.org>

Hi Wen,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on ath6kl/ath-next]
[also build test WARNING on v4.18 next-20180814]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Wen-Gong/ath10k-support-NET_DETECT-WoWLAN-feature/20180814-174257
base:   https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git ath-next


coccinelle warnings: (new ones prefixed by >>)

>> drivers/net/wireless/ath/ath10k/wow.c:321:3-6: alloc with no test, possible model on line 324

vim +321 drivers/net/wireless/ath/ath10k/wow.c

   282	
   283	static int ath10k_vif_wow_set_wakeups(struct ath10k_vif *arvif,
   284					      struct cfg80211_wowlan *wowlan)
   285	{
   286		int ret, i;
   287		unsigned long wow_mask = 0;
   288		struct ath10k *ar = arvif->ar;
   289		const struct cfg80211_pkt_pattern *patterns = wowlan->patterns;
   290		int pattern_id = 0;
   291	
   292		/* Setup requested WOW features */
   293		switch (arvif->vdev_type) {
   294		case WMI_VDEV_TYPE_IBSS:
   295			__set_bit(WOW_BEACON_EVENT, &wow_mask);
   296			 /* fall through */
   297		case WMI_VDEV_TYPE_AP:
   298			__set_bit(WOW_DEAUTH_RECVD_EVENT, &wow_mask);
   299			__set_bit(WOW_DISASSOC_RECVD_EVENT, &wow_mask);
   300			__set_bit(WOW_PROBE_REQ_WPS_IE_EVENT, &wow_mask);
   301			__set_bit(WOW_AUTH_REQ_EVENT, &wow_mask);
   302			__set_bit(WOW_ASSOC_REQ_EVENT, &wow_mask);
   303			__set_bit(WOW_HTT_EVENT, &wow_mask);
   304			__set_bit(WOW_RA_MATCH_EVENT, &wow_mask);
   305			break;
   306		case WMI_VDEV_TYPE_STA:
   307			if (wowlan->disconnect) {
   308				__set_bit(WOW_DEAUTH_RECVD_EVENT, &wow_mask);
   309				__set_bit(WOW_DISASSOC_RECVD_EVENT, &wow_mask);
   310				__set_bit(WOW_BMISS_EVENT, &wow_mask);
   311				__set_bit(WOW_CSA_IE_EVENT, &wow_mask);
   312			}
   313	
   314			if (wowlan->magic_pkt)
   315				__set_bit(WOW_MAGIC_PKT_RECVD_EVENT, &wow_mask);
   316	
   317			if (wowlan->nd_config) {
   318				struct wmi_pno_scan_req *pno;
   319				int ret;
   320	
 > 321				pno = kzalloc(sizeof(*pno), GFP_KERNEL);
   322				ar->nlo_enabled = true;
   323	
 > 324				ret = ath10k_wmi_pno_check(ar, arvif->vdev_id,
   325							   wowlan->nd_config, pno);
   326				if (!ret) {
   327					ath10k_wmi_wow_config_pno(ar, arvif->vdev_id, pno);
   328					__set_bit(WOW_NLO_DETECTED_EVENT, &wow_mask);
   329				}
   330	
   331				kfree(pno);
   332			}
   333			break;
   334		default:
   335			break;
   336		}
   337	
   338		for (i = 0; i < wowlan->n_patterns; i++) {
   339			u8 bitmask[WOW_MAX_PATTERN_SIZE] = {};
   340			u8 ath_pattern[WOW_MAX_PATTERN_SIZE] = {};
   341			u8 ath_bitmask[WOW_MAX_PATTERN_SIZE] = {};
   342			struct cfg80211_pkt_pattern new_pattern = {};
   343			struct cfg80211_pkt_pattern old_pattern = patterns[i];
   344			int j;
   345	
   346			new_pattern.pattern = ath_pattern;
   347			new_pattern.mask = ath_bitmask;
   348			if (patterns[i].pattern_len > WOW_MAX_PATTERN_SIZE)
   349				continue;
   350			/* convert bytemask to bitmask */
   351			for (j = 0; j < patterns[i].pattern_len; j++)
   352				if (patterns[i].mask[j / 8] & BIT(j % 8))
   353					bitmask[j] = 0xff;
   354			old_pattern.mask = bitmask;
   355			new_pattern = old_pattern;
   356	
   357			if (ar->wmi.rx_decap_mode == ATH10K_HW_TXRX_NATIVE_WIFI) {
   358				if (patterns[i].pkt_offset < ETH_HLEN)
   359					ath10k_wow_convert_8023_to_80211(&new_pattern,
   360									 &old_pattern);
   361				else
   362					new_pattern.pkt_offset += WOW_HDR_LEN - ETH_HLEN;
   363			}
   364	
   365			if (WARN_ON(new_pattern.pattern_len > WOW_MAX_PATTERN_SIZE))
   366				return -EINVAL;
   367	
   368			ret = ath10k_wmi_wow_add_pattern(ar, arvif->vdev_id,
   369							 pattern_id,
   370							 new_pattern.pattern,
   371							 new_pattern.mask,
   372							 new_pattern.pattern_len,
   373							 new_pattern.pkt_offset);
   374			if (ret) {
   375				ath10k_warn(ar, "failed to add pattern %i to vdev %i: %d\n",
   376					    pattern_id,
   377					    arvif->vdev_id, ret);
   378				return ret;
   379			}
   380	
   381			pattern_id++;
   382			__set_bit(WOW_PATTERN_MATCH_EVENT, &wow_mask);
   383		}
   384	
   385		for (i = 0; i < WOW_EVENT_MAX; i++) {
   386			if (!test_bit(i, &wow_mask))
   387				continue;
   388			ret = ath10k_wmi_wow_add_wakeup_event(ar, arvif->vdev_id, i, 1);
   389			if (ret) {
   390				ath10k_warn(ar, "failed to enable wakeup event %s on vdev %i: %d\n",
   391					    wow_wakeup_event(i), arvif->vdev_id, ret);
   392				return ret;
   393			}
   394		}
   395	
   396		return 0;
   397	}
   398	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

      parent reply	other threads:[~2018-08-15 21:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-14  2:42 [PATCH] ath10k: support NET_DETECT WoWLAN feature Wen Gong
2018-08-14 12:52 ` kbuild test robot
2018-08-14 14:05 ` kbuild test robot
2018-08-15 21:23 ` kbuild test robot [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201808160528.6RYbuvHS%fengguang.wu@intel.com \
    --to=lkp@intel.com \
    --cc=ath10k@lists.infradead.org \
    --cc=kbuild-all@01.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=wgong@codeaurora.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox