<feed xmlns='http://www.w3.org/2005/Atom'>
<title>lwn.git/net/mac80211/mesh_ps.c, branch docs-4.14</title>
<subtitle>Linux kernel documentation tree maintained by Jonathan Corbet</subtitle>
<id>http://mirrors.hust.edu.cn/git/lwn.git/atom?h=docs-4.14</id>
<link rel='self' href='http://mirrors.hust.edu.cn/git/lwn.git/atom?h=docs-4.14'/>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/'/>
<updated>2017-06-16T15:48:39+00:00</updated>
<entry>
<title>networking: make skb_put &amp; friends return void pointers</title>
<updated>2017-06-16T15:48:39+00:00</updated>
<author>
<name>Johannes Berg</name>
<email>johannes.berg@intel.com</email>
</author>
<published>2017-06-16T12:29:21+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=4df864c1d9afb46e2461a9f808d9f11a42d31bad'/>
<id>urn:sha1:4df864c1d9afb46e2461a9f808d9f11a42d31bad</id>
<content type='text'>
It seems like a historic accident that these return unsigned char *,
and in many places that means casts are required, more often than not.

Make these functions (skb_put, __skb_put and pskb_put) return void *
and remove all the casts across the tree, adding a (u8 *) cast only
where the unsigned char pointer was used directly, all done with the
following spatch:

    @@
    expression SKB, LEN;
    typedef u8;
    identifier fn = { skb_put, __skb_put };
    @@
    - *(fn(SKB, LEN))
    + *(u8 *)fn(SKB, LEN)

    @@
    expression E, SKB, LEN;
    identifier fn = { skb_put, __skb_put };
    type T;
    @@
    - E = ((T *)(fn(SKB, LEN)))
    + E = fn(SKB, LEN)

which actually doesn't cover pskb_put since there are only three
users overall.

A handful of stragglers were converted manually, notably a macro in
drivers/isdn/i4l/isdn_bsdcomp.c and, oddly enough, one of the many
instances in net/bluetooth/hci_sock.c. In the former file, I also
had to fix one whitespace problem spatch introduced.

Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>networking: convert many more places to skb_put_zero()</title>
<updated>2017-06-16T15:48:35+00:00</updated>
<author>
<name>Johannes Berg</name>
<email>johannes.berg@intel.com</email>
</author>
<published>2017-06-16T12:29:19+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=b080db585384b9f037e015c0c28d1ad33be41dfc'/>
<id>urn:sha1:b080db585384b9f037e015c0c28d1ad33be41dfc</id>
<content type='text'>
There were many places that my previous spatch didn't find,
as pointed out by yuan linyu in various patches.

The following spatch found many more and also removes the
now unnecessary casts:

    @@
    identifier p, p2;
    expression len;
    expression skb;
    type t, t2;
    @@
    (
    -p = skb_put(skb, len);
    +p = skb_put_zero(skb, len);
    |
    -p = (t)skb_put(skb, len);
    +p = skb_put_zero(skb, len);
    )
    ... when != p
    (
    p2 = (t2)p;
    -memset(p2, 0, len);
    |
    -memset(p, 0, len);
    )

    @@
    type t, t2;
    identifier p, p2;
    expression skb;
    @@
    t *p;
    ...
    (
    -p = skb_put(skb, sizeof(t));
    +p = skb_put_zero(skb, sizeof(t));
    |
    -p = (t *)skb_put(skb, sizeof(t));
    +p = skb_put_zero(skb, sizeof(t));
    )
    ... when != p
    (
    p2 = (t2)p;
    -memset(p2, 0, sizeof(*p));
    |
    -memset(p, 0, sizeof(*p));
    )

    @@
    expression skb, len;
    @@
    -memset(skb_put(skb, len), 0, len);
    +skb_put_zero(skb, len);

Apply it to the tree (with one manual fixup to keep the
comment in vxlan.c, which spatch removed.)

Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>mac80211: mesh: separate plid and aid concepts</title>
<updated>2015-07-17T13:47:11+00:00</updated>
<author>
<name>Bob Copeland</name>
<email>me@bobcopeland.com</email>
</author>
<published>2015-07-14T12:31:58+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=a69bd8e60b02946896c097439b94eb77c0c2c9e4'/>
<id>urn:sha1:a69bd8e60b02946896c097439b94eb77c0c2c9e4</id>
<content type='text'>
According to 802.11-2012 13.3.1, a mesh STA should assign an AID
upon receipt of a mesh peering open frame rather than using the link
id of the peer.  Using the peer link id has two potential issues:
it may not be unique among the peers, and by its nature it is random,
so the TIM may not compress well.

In preparation for allocating it properly, use sta-&gt;sta.aid, but keep
the existing behavior of using the plid in the aid we send.

Signed-off-by: Bob Copeland &lt;me@bobcopeland.com&gt;
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
</content>
</entry>
<entry>
<title>mac80211: move mesh related station fields to own struct</title>
<updated>2015-07-17T13:38:06+00:00</updated>
<author>
<name>Johannes Berg</name>
<email>johannes.berg@intel.com</email>
</author>
<published>2015-06-17T08:31:00+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=433f5bc1c0efc67a86433e47a14b115510fc1409'/>
<id>urn:sha1:433f5bc1c0efc67a86433e47a14b115510fc1409</id>
<content type='text'>
There are now a fairly large number of mesh fields that really
aren't needed in any other modes; move those into their own
structure and allocate them separately.

Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
</content>
</entry>
<entry>
<title>mac80211: clear sequence/fragment number in QoS-null frames</title>
<updated>2014-03-05T14:49:54+00:00</updated>
<author>
<name>Johannes Berg</name>
<email>johannes.berg@intel.com</email>
</author>
<published>2014-03-04T12:46:53+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=864a6040f395464003af8dd0d8ca86fed19866d4'/>
<id>urn:sha1:864a6040f395464003af8dd0d8ca86fed19866d4</id>
<content type='text'>
Avoid leaking data by sending uninitialized memory and setting an
invalid (non-zero) fragment number (the sequence number is ignored
anyway) by setting the seq_ctrl field to zero.

Cc: stable@vger.kernel.org
Fixes: 3f52b7e328c5 ("mac80211: mesh power save basics")
Fixes: ce662b44ce22 ("mac80211: send (QoS) Null if no buffered frames")
Reviewed-by: Emmanuel Grumbach &lt;emmanuel.grumbach@intel.com&gt;
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
</content>
</entry>
<entry>
<title>mac80211: use put_unaligned_le16 in mesh_plink_frame_tx</title>
<updated>2013-11-25T19:51:53+00:00</updated>
<author>
<name>Chun-Yeow Yeoh</name>
<email>yeohchunyeow@gmail.com</email>
</author>
<published>2013-11-13T07:43:03+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=6f101ef04b77bcad71049e07007d34d14cab7b2f'/>
<id>urn:sha1:6f101ef04b77bcad71049e07007d34d14cab7b2f</id>
<content type='text'>
Use put_unaligned_le16 in mesh_plink_frame_tx.

Signed-off-by: Chun-Yeow Yeoh &lt;yeohchunyeow@gmail.com&gt;
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
</content>
</entry>
<entry>
<title>mac80211: clean up mesh local link ID generation</title>
<updated>2013-11-25T19:50:29+00:00</updated>
<author>
<name>Thomas Pedersen</name>
<email>thomas@cozybit.com</email>
</author>
<published>2013-11-05T19:17:05+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=204d130426206071b08c0aa74002fbdb67960eed'/>
<id>urn:sha1:204d130426206071b08c0aa74002fbdb67960eed</id>
<content type='text'>
802.11-2012 13.3.1 implicitly limits the mesh local link
ID range to that of AID, since for mesh PS the local link
ID must be indicated in the TIM IE, which only holds
IEEE80211_MAX_AID bits.

Also the code was allowing a local link ID of 0, but this
is not correct since that TIM bit is used for indicating
buffered mcast frames.

Generate a random, unique, link ID from 1 - 2007, and drop
a modulo conversion for the local link ID, but keep it for
the peer link ID in case he chose something &gt; MAX_AID.

Signed-off-by: Thomas Pedersen &lt;thomas@cozybit.com&gt;
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
</content>
</entry>
<entry>
<title>mac80211: fixes for mesh powersave logic</title>
<updated>2013-10-28T14:05:26+00:00</updated>
<author>
<name>Marco Porsch</name>
<email>marco@cozybit.com</email>
</author>
<published>2013-10-15T10:29:24+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=446075d76b6cc48ed15c515e836dd1a1f25f4c3d'/>
<id>urn:sha1:446075d76b6cc48ed15c515e836dd1a1f25f4c3d</id>
<content type='text'>
This patch fixes errors in the mesh powersave logic which
cause that remote peers do not get peer power mode change
notifications and mesh peer service periods (MPSPs) got
stuck.

When closing a peer link, set the (now invalid) peer-specific
power mode to 'unknown'.

Avoid overhead when local power mode is unchanged.

Reliably clear MPSP flags on peering status update.

Avoid MPSP flags getting stuck by not requesting a further
MPSP ownership if we already are an MPSP owner.

Signed-off-by: Marco Porsch &lt;marco@cozybit.com&gt;
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
</content>
</entry>
<entry>
<title>mac80211: prevent the buffering or frame transmission to non-assoc mesh STA</title>
<updated>2013-07-22T13:32:47+00:00</updated>
<author>
<name>Chun-Yeow Yeoh</name>
<email>yeohchunyeow@gmail.com</email>
</author>
<published>2013-07-19T09:37:39+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=40d18ff959fe8b847be4f7b03f84644a7c18211e'/>
<id>urn:sha1:40d18ff959fe8b847be4f7b03f84644a7c18211e</id>
<content type='text'>
This patch is intended to avoid the buffering to non-assoc mesh STA
and also to avoid the triggering of frame to non-assoc mesh STA which
could cause kernel panic in specific hw.

One of the examples, is kernel panic happens to ath9k if user space
inserts the mesh STA and not proceed with the SAE and AMPE, and later
the same mesh STA is detected again. The sta_state of the mesh STA remains
at IEEE80211_STA_NONE and if the ieee80211_sta_ps_deliver_wakeup is called
and subsequently the ath_tx_aggr_wakeup, the kernel panic due to
ath_tx_node_init is not called before to initialize the require data
structures.

This issue is reported by Cedric Voncken before.
http://www.spinics.net/lists/linux-wireless/msg106342.html

[&lt;831ea6b4&gt;] ath_tx_aggr_wakeup+0x44/0xcc [ath9k]
[&lt;83084214&gt;] ieee80211_sta_ps_deliver_wakeup+0xb8/0x208 [mac80211]
[&lt;830b9824&gt;] ieee80211_mps_sta_status_update+0x94/0x108 [mac80211]
[&lt;83099398&gt;] ieee80211_sta_ps_transition+0xc94/0x34d8 [mac80211]
[&lt;8022399c&gt;] nf_iterate+0x98/0x104
[&lt;8309bb60&gt;] ieee80211_sta_ps_transition+0x345c/0x34d8 [mac80211]

Signed-off-by: Chun-Yeow Yeoh &lt;yeohchunyeow@gmail.com&gt;
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
</content>
</entry>
<entry>
<title>mac80211: consolidate MBSS change notification</title>
<updated>2013-02-15T08:41:09+00:00</updated>
<author>
<name>Thomas Pedersen</name>
<email>thomas@cozybit.com</email>
</author>
<published>2013-02-13T20:14:19+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=39886b618aba3c39e650c191d601e26ec581ce0f'/>
<id>urn:sha1:39886b618aba3c39e650c191d601e26ec581ce0f</id>
<content type='text'>
A few mesh utility functions will call
ieee80211_bss_info_change_notify(), and then the caller
might notify the driver of the same change again. Avoid
this redundancy by propagating the BSS changes and
generally calling bss_info_change_notify() once per
change.

Signed-off-by: Thomas Pedersen &lt;thomas@cozybit.com&gt;
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
</content>
</entry>
</feed>
