<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/drivers/net/wireless/ath/dfs_pattern_detector.c, branch linux-6.9.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-6.9.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-6.9.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2023-10-02T16:58:33Z</updated>
<entry>
<title>wifi: ath: dfs_pattern_detector: Use flex array to simplify code</title>
<updated>2023-10-02T16:58:33Z</updated>
<author>
<name>Christophe JAILLET</name>
<email>christophe.jaillet@wanadoo.fr</email>
</author>
<published>2023-09-30T04:54:48Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=27e154abf6940d6478ca698019fb1ce783e85602'/>
<id>urn:sha1:27e154abf6940d6478ca698019fb1ce783e85602</id>
<content type='text'>
At the time of the writing, the value of 'num_radar_types' is 7 or 9. So
on a 64 bits system, only 56 or 72 bytes are allocated for the
'detectors' array.

Turn it into a flex array, in order to simplify memory management and save
an indirection when the array is used.

Doing so, cd-&gt;detectors can't be NULL, and channel_detector_exit() can be
simplified as well.

Signed-off-by: Christophe JAILLET &lt;christophe.jaillet@wanadoo.fr&gt;
Reviewed-by: Jeff Johnson &lt;quic_jjohnson@quicinc.com&gt;
Signed-off-by: Kalle Valo &lt;quic_kvalo@quicinc.com&gt;
Link: https://lore.kernel.org/r/1920cc38db2e570633e13b37d50852f3202a7270.1695538105.git.christophe.jaillet@wanadoo.fr
</content>
</entry>
<entry>
<title>wifi: ath: dfs_pattern_detector: Fix a memory initialization issue</title>
<updated>2023-10-02T16:58:33Z</updated>
<author>
<name>Christophe JAILLET</name>
<email>christophe.jaillet@wanadoo.fr</email>
</author>
<published>2023-09-30T04:54:47Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=79bd60ee87e1136718a686d6617ced5de88ee350'/>
<id>urn:sha1:79bd60ee87e1136718a686d6617ced5de88ee350</id>
<content type='text'>
If an error occurs and channel_detector_exit() is called, it relies on
entries of the 'detectors' array to be NULL.
Otherwise, it may access to un-initialized memory.

Fix it and initialize the memory, as what was done before the commit in
Fixes.

Fixes: a063b650ce5d ("ath: dfs_pattern_detector: Avoid open coded arithmetic in memory allocation")
Signed-off-by: Christophe JAILLET &lt;christophe.jaillet@wanadoo.fr&gt;
Reviewed-by: Jeff Johnson &lt;quic_jjohnson@quicinc.com&gt;
Signed-off-by: Kalle Valo &lt;quic_kvalo@quicinc.com&gt;
Link: https://lore.kernel.org/r/ad8c55b97ee4b330cb053ce2c448123c309cc91c.1695538105.git.christophe.jaillet@wanadoo.fr
</content>
</entry>
<entry>
<title>ath: dfs_pattern_detector: Avoid open coded arithmetic in memory allocation</title>
<updated>2022-01-17T12:41:51Z</updated>
<author>
<name>Christophe JAILLET</name>
<email>christophe.jaillet@wanadoo.fr</email>
</author>
<published>2021-12-27T16:58:10Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=a063b650ce5d72585d780d653a123f9f273b7877'/>
<id>urn:sha1:a063b650ce5d72585d780d653a123f9f273b7877</id>
<content type='text'>
kmalloc_array()/kcalloc() should be used to avoid potential overflow when
a multiplication is needed to compute the size of the requested memory.

kmalloc_array() can be used here instead of kcalloc() because the array is
fully initialized in the next 'for' loop.

Finally, 'cd-&gt;detectors' is defined as 'struct pri_detector **detectors;'.
So 'cd-&gt;detectors' and '*cd-&gt;detectors' are both some pointer.
So use a more logical 'sizeof(*cd-&gt;detectors)'.

Signed-off-by: Christophe JAILLET &lt;christophe.jaillet@wanadoo.fr&gt;
Signed-off-by: Kalle Valo &lt;quic_kvalo@quicinc.com&gt;
Link: https://lore.kernel.org/r/0fbcd32a0384ac1f87c5a3549e505e4becc60226.1640624216.git.christophe.jaillet@wanadoo.fr
</content>
</entry>
<entry>
<title>ath: dfs_pattern_detector: Fix possible null-pointer dereference in channel_detector_create()</title>
<updated>2021-10-11T06:26:10Z</updated>
<author>
<name>Tuo Li</name>
<email>islituo@gmail.com</email>
</author>
<published>2021-08-05T15:38:53Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=4b6012a7830b813799a7faf40daa02a837e0fd5b'/>
<id>urn:sha1:4b6012a7830b813799a7faf40daa02a837e0fd5b</id>
<content type='text'>
kzalloc() is used to allocate memory for cd-&gt;detectors, and if it fails,
channel_detector_exit() behind the label fail will be called:
  channel_detector_exit(dpd, cd);

In channel_detector_exit(), cd-&gt;detectors is dereferenced through:
  struct pri_detector *de = cd-&gt;detectors[i];

To fix this possible null-pointer dereference, check cd-&gt;detectors before
the for loop to dereference cd-&gt;detectors.

Reported-by: TOTE Robot &lt;oslab@tsinghua.edu.cn&gt;
Signed-off-by: Tuo Li &lt;islituo@gmail.com&gt;
Signed-off-by: Kalle Valo &lt;kvalo@codeaurora.org&gt;
Link: https://lore.kernel.org/r/20210805153854.154066-1-islituo@gmail.com
</content>
</entry>
<entry>
<title>ath: dfs_pattern_detector: Fix some function kernel-doc headers</title>
<updated>2020-11-07T08:06:46Z</updated>
<author>
<name>Lee Jones</name>
<email>lee.jones@linaro.org</email>
</author>
<published>2020-11-02T11:23:50Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=206cd5800d8c7893b69bde0e607321e934815a54'/>
<id>urn:sha1:206cd5800d8c7893b69bde0e607321e934815a54</id>
<content type='text'>
Fixes the following W=1 kernel build warning(s):

 drivers/net/wireless/ath/dfs_pattern_detector.c:34: warning: Function parameter or member 'region' not described in 'radar_types'
 drivers/net/wireless/ath/dfs_pattern_detector.c:141: warning: Function parameter or member 'region' not described in 'get_dfs_domain_radar_types'
 drivers/net/wireless/ath/dfs_pattern_detector.c:239: warning: Function parameter or member 'dpd' not described in 'channel_detector_get'
 drivers/net/wireless/ath/dfs_pattern_detector.c:239: warning: Function parameter or member 'freq' not described in 'channel_detector_get'

Cc: Kalle Valo &lt;kvalo@codeaurora.org&gt;
Cc: "David S. Miller" &lt;davem@davemloft.net&gt;
Cc: Jakub Kicinski &lt;kuba@kernel.org&gt;
Cc: linux-wireless@vger.kernel.org
Cc: netdev@vger.kernel.org
Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
Signed-off-by: Kalle Valo &lt;kvalo@codeaurora.org&gt;
Link: https://lore.kernel.org/r/20201102112410.1049272-22-lee.jones@linaro.org
</content>
</entry>
<entry>
<title>ath: drop unnecessary list_empty</title>
<updated>2020-08-14T15:05:06Z</updated>
<author>
<name>Julia Lawall</name>
<email>Julia.Lawall@inria.fr</email>
</author>
<published>2020-07-26T10:58:32Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=18c25b4019caa94deee67e839aea6b7b626e70d5'/>
<id>urn:sha1:18c25b4019caa94deee67e839aea6b7b626e70d5</id>
<content type='text'>
list_for_each_entry{_safe} is able to handle an empty list.
The only effect of avoiding the loop is not initializing the
index variable.
Drop list_empty tests in cases where these variables are not
used.

Note that list_for_each_entry{_safe} is defined in terms of
list_first_entry, which indicates that it should not be used on an
empty list.  But in list_for_each_entry{_safe}, the element obtained
by list_first_entry is not really accessed, only the address of its
list_head field is compared to the address of the list head, so the
list_first_entry is safe.

The semantic patch that makes this change for the list_for_each_entry
case is as follows: (http://coccinelle.lip6.fr/)

&lt;smpl&gt;
@@
expression x,e;
statement S;
identifier i;
@@

-if (!(list_empty(x)))
   list_for_each_entry(i,x,...) S
 ... when != i
? i = e
&lt;/smpl&gt;

Signed-off-by: Julia Lawall &lt;Julia.Lawall@inria.fr&gt;
Signed-off-by: Kalle Valo &lt;kvalo@codeaurora.org&gt;
Link: https://lore.kernel.org/r/1595761112-11003-8-git-send-email-Julia.Lawall@inria.fr
</content>
</entry>
<entry>
<title>ath: DFS JP domain W56 fixed pulse type 3 RADAR detection</title>
<updated>2019-04-29T14:58:51Z</updated>
<author>
<name>Anilkumar Kolli</name>
<email>akolli@codeaurora.org</email>
</author>
<published>2019-03-06T17:36:11Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=d8792393a783158cbb2c39939cb897dc5e5299b6'/>
<id>urn:sha1:d8792393a783158cbb2c39939cb897dc5e5299b6</id>
<content type='text'>
Increase pulse width range from 1-2usec to 0-4usec.
During data traffic HW occasionally fails detecting radar pulses,
so that SW cannot get enough radar reports to achieve the success rate.

Tested ath10k hw and fw:
	* QCA9888(10.4-3.5.1-00052)
	* QCA4019(10.4-3.2.1.1-00017)
	* QCA9984(10.4-3.6-00104)
	* QCA988X(10.2.4-1.0-00041)

Tested ath9k hw: AR9300

Tested-by: Tamizh chelvam &lt;tamizhr@codeaurora.org&gt;
Signed-off-by: Tamizh chelvam &lt;tamizhr@codeaurora.org&gt;
Signed-off-by: Anilkumar Kolli &lt;akolli@codeaurora.org&gt;
Signed-off-by: Kalle Valo &lt;kvalo@codeaurora.org&gt;
</content>
</entry>
<entry>
<title>ath: add support to get the detected radar specifications</title>
<updated>2018-05-25T10:15:21Z</updated>
<author>
<name>Sriram R</name>
<email>srirrama@codeaurora.org</email>
</author>
<published>2018-05-15T09:09:48Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=f40105e6747892e8edab94020567c158c9bec0df'/>
<id>urn:sha1:f40105e6747892e8edab94020567c158c9bec0df</id>
<content type='text'>
This enables ath10k/ath9k drivers to collect the specifications of the
radar type once it is detected by the dfs pattern detector unit.
Usage of the collected info is specific to driver implementation.
For example, collected radar info could be used by the host driver
to send to co-processors for additional processing/validation.

Note: 'radar_detector_specs' data containing the specifications of
different radar types which was private within dfs_pattern_detector/
dfs_pri_detector is now shared with drivers as well for making use
of this information.

Signed-off-by: Sriram R &lt;srirrama@codeaurora.org&gt;
Signed-off-by: Kalle Valo &lt;kvalo@codeaurora.org&gt;
</content>
</entry>
<entry>
<title>ath: fix false radar detection in JP region</title>
<updated>2018-03-26T15:09:57Z</updated>
<author>
<name>Sriram R</name>
<email>srirrama@codeaurora.org</email>
</author>
<published>2018-03-14T10:14:10Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=ba21ac6cdaef2d0dd51bccbd86547b7f34f7bdc1'/>
<id>urn:sha1:ba21ac6cdaef2d0dd51bccbd86547b7f34f7bdc1</id>
<content type='text'>
This fixes false radar detection (of radar type 7)
in Japan region by correcting the radar pulse type
to Chirp as per specification.

Signed-off-by: Sriram R &lt;srirrama@codeaurora.org&gt;
Signed-off-by: Kalle Valo &lt;kvalo@codeaurora.org&gt;
</content>
</entry>
<entry>
<title>ath: constify local structures</title>
<updated>2016-09-14T17:01:39Z</updated>
<author>
<name>Julia Lawall</name>
<email>Julia.Lawall@lip6.fr</email>
</author>
<published>2016-09-11T13:05:48Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=8136fd58ad60e25cf8b99d08bf92c09d02b416ef'/>
<id>urn:sha1:8136fd58ad60e25cf8b99d08bf92c09d02b416ef</id>
<content type='text'>
For structure types defined in the same file or local header files, find
top-level static structure declarations that have the following
properties:
1. Never reassigned.
2. Address never taken
3. Not passed to a top-level macro call
4. No pointer or array-typed field passed to a function or stored in a
variable.
Declare structures having all of these properties as const.

Done using Coccinelle.
Based on a suggestion by Joe Perches &lt;joe@perches.com&gt;.

Signed-off-by: Julia Lawall &lt;Julia.Lawall@lip6.fr&gt;
Signed-off-by: Kalle Valo &lt;kvalo@codeaurora.org&gt;
</content>
</entry>
</feed>
