<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c, branch vsnprintf</title>
<subtitle>Linux kernel source tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/'/>
<entry>
<title>wifi: rt2x00: restart beacon queue when hardware reset</title>
<updated>2023-11-08T18:14:10+00:00</updated>
<author>
<name>Shiji Yang</name>
<email>yangshiji66@outlook.com</email>
</author>
<published>2023-11-04T08:58:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=a11d965a218f0cd95b13fe44d0bcd8a20ce134a8'/>
<id>a11d965a218f0cd95b13fe44d0bcd8a20ce134a8</id>
<content type='text'>
When a hardware reset is triggered, all registers are reset, so all
queues are forced to stop in hardware interface. However, mac80211
will not automatically stop the queue. If we don't manually stop the
beacon queue, the queue will be deadlocked and unable to start again.
This patch fixes the issue where Apple devices cannot connect to the
AP after calling ieee80211_restart_hw().

Signed-off-by: Shiji Yang &lt;yangshiji66@outlook.com&gt;
Acked-by: Stanislaw Gruszka &lt;stf_xl@wp.pl&gt;
Signed-off-by: Kalle Valo &lt;kvalo@kernel.org&gt;
Link: https://lore.kernel.org/r/TYAP286MB031530EB6D98DCE4DF20766CBCA4A@TYAP286MB0315.JPNP286.PROD.OUTLOOK.COM
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When a hardware reset is triggered, all registers are reset, so all
queues are forced to stop in hardware interface. However, mac80211
will not automatically stop the queue. If we don't manually stop the
beacon queue, the queue will be deadlocked and unable to start again.
This patch fixes the issue where Apple devices cannot connect to the
AP after calling ieee80211_restart_hw().

Signed-off-by: Shiji Yang &lt;yangshiji66@outlook.com&gt;
Acked-by: Stanislaw Gruszka &lt;stf_xl@wp.pl&gt;
Signed-off-by: Kalle Valo &lt;kvalo@kernel.org&gt;
Link: https://lore.kernel.org/r/TYAP286MB031530EB6D98DCE4DF20766CBCA4A@TYAP286MB0315.JPNP286.PROD.OUTLOOK.COM
</pre>
</div>
</content>
</entry>
<entry>
<title>wifi: mac80211: rename ieee80211_tx_status() to ieee80211_tx_status_skb()</title>
<updated>2023-10-23T10:26:51+00:00</updated>
<author>
<name>Kalle Valo</name>
<email>quic_kvalo@quicinc.com</email>
</author>
<published>2023-10-12T11:42:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=2703bc8513996e848b5aefa2deb1ff3baae5d79b'/>
<id>2703bc8513996e848b5aefa2deb1ff3baae5d79b</id>
<content type='text'>
make htmldocs warns:

Documentation/driver-api/80211/mac80211:109: ./include/net/mac80211.h:5170: WARNING: Duplicate C declaration, also defined at mac80211:1117.
Declaration is '.. c:function:: void ieee80211_tx_status (struct ieee80211_hw *hw, struct sk_buff *skb)'.

This is because there's a function named ieee80211_tx_status() and a struct named
ieee80211_tx_status. This has been discussed previously but no solution found:

https://lore.kernel.org/all/20220521114629.6ee9fc06@coco.lan/

There's also a bug open for three years with no solution in sight:

https://github.com/sphinx-doc/sphinx/pull/8313

So I guess we have no other solution than to a workaround this in the code,
for example to rename the function to ieee80211_tx_status_skb() to avoid the
name conflict. I got the idea for the name from ieee80211_tx_status_noskb() in
which the skb is not provided as an argument, instead with
ieee80211_tx_status_skb() the skb is provided.

Compile tested only.

Signed-off-by: Kalle Valo &lt;quic_kvalo@quicinc.com&gt;
Link: https://lore.kernel.org/r/20231012114229.2931808-2-kvalo@kernel.org
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
make htmldocs warns:

Documentation/driver-api/80211/mac80211:109: ./include/net/mac80211.h:5170: WARNING: Duplicate C declaration, also defined at mac80211:1117.
Declaration is '.. c:function:: void ieee80211_tx_status (struct ieee80211_hw *hw, struct sk_buff *skb)'.

This is because there's a function named ieee80211_tx_status() and a struct named
ieee80211_tx_status. This has been discussed previously but no solution found:

https://lore.kernel.org/all/20220521114629.6ee9fc06@coco.lan/

There's also a bug open for three years with no solution in sight:

https://github.com/sphinx-doc/sphinx/pull/8313

So I guess we have no other solution than to a workaround this in the code,
for example to rename the function to ieee80211_tx_status_skb() to avoid the
name conflict. I got the idea for the name from ieee80211_tx_status_noskb() in
which the skb is not provided as an argument, instead with
ieee80211_tx_status_skb() the skb is provided.

Compile tested only.

Signed-off-by: Kalle Valo &lt;quic_kvalo@quicinc.com&gt;
Link: https://lore.kernel.org/r/20231012114229.2931808-2-kvalo@kernel.org
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>wifi: rt2x00: Fix memory leak when handling surveys</title>
<updated>2023-04-03T13:44:27+00:00</updated>
<author>
<name>Armin Wolf</name>
<email>W_Armin@gmx.de</email>
</author>
<published>2023-03-30T21:56:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=cbef9a83c51dfcb07f77cfa6ac26f53a1ea86f49'/>
<id>cbef9a83c51dfcb07f77cfa6ac26f53a1ea86f49</id>
<content type='text'>
When removing a rt2x00 device, its associated channel surveys
are not freed, causing a memory leak observable with kmemleak:

unreferenced object 0xffff9620f0881a00 (size 512):
  comm "systemd-udevd", pid 2290, jiffies 4294906974 (age 33.768s)
  hex dump (first 32 bytes):
    70 44 12 00 00 00 00 00 92 8a 00 00 00 00 00 00  pD..............
    00 00 00 00 00 00 00 00 ab 87 01 00 00 00 00 00  ................
  backtrace:
    [&lt;ffffffffb0ed858b&gt;] __kmalloc+0x4b/0x130
    [&lt;ffffffffc1b0f29b&gt;] rt2800_probe_hw+0xc2b/0x1380 [rt2800lib]
    [&lt;ffffffffc1a9496e&gt;] rt2800usb_probe_hw+0xe/0x60 [rt2800usb]
    [&lt;ffffffffc1ae491a&gt;] rt2x00lib_probe_dev+0x21a/0x7d0 [rt2x00lib]
    [&lt;ffffffffc1b3b83e&gt;] rt2x00usb_probe+0x1be/0x980 [rt2x00usb]
    [&lt;ffffffffc05981e2&gt;] usb_probe_interface+0xe2/0x310 [usbcore]
    [&lt;ffffffffb13be2d5&gt;] really_probe+0x1a5/0x410
    [&lt;ffffffffb13be5c8&gt;] __driver_probe_device+0x78/0x180
    [&lt;ffffffffb13be6fe&gt;] driver_probe_device+0x1e/0x90
    [&lt;ffffffffb13be972&gt;] __driver_attach+0xd2/0x1c0
    [&lt;ffffffffb13bbc57&gt;] bus_for_each_dev+0x77/0xd0
    [&lt;ffffffffb13bd2a2&gt;] bus_add_driver+0x112/0x210
    [&lt;ffffffffb13bfc6c&gt;] driver_register+0x5c/0x120
    [&lt;ffffffffc0596ae8&gt;] usb_register_driver+0x88/0x150 [usbcore]
    [&lt;ffffffffb0c011c4&gt;] do_one_initcall+0x44/0x220
    [&lt;ffffffffb0d6134c&gt;] do_init_module+0x4c/0x220

Fix this by freeing the channel surveys on device removal.

Tested with a RT3070 based USB wireless adapter.

Fixes: 5447626910f5 ("rt2x00: save survey for every channel visited")
Signed-off-by: Armin Wolf &lt;W_Armin@gmx.de&gt;
Reviewed-by: Simon Horman &lt;simon.horman@corigine.com&gt;
Acked-by: Stanislaw Gruszka &lt;stf_xl@wp.pl&gt;
Signed-off-by: Kalle Valo &lt;kvalo@kernel.org&gt;
Link: https://lore.kernel.org/r/20230330215637.4332-1-W_Armin@gmx.de
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When removing a rt2x00 device, its associated channel surveys
are not freed, causing a memory leak observable with kmemleak:

unreferenced object 0xffff9620f0881a00 (size 512):
  comm "systemd-udevd", pid 2290, jiffies 4294906974 (age 33.768s)
  hex dump (first 32 bytes):
    70 44 12 00 00 00 00 00 92 8a 00 00 00 00 00 00  pD..............
    00 00 00 00 00 00 00 00 ab 87 01 00 00 00 00 00  ................
  backtrace:
    [&lt;ffffffffb0ed858b&gt;] __kmalloc+0x4b/0x130
    [&lt;ffffffffc1b0f29b&gt;] rt2800_probe_hw+0xc2b/0x1380 [rt2800lib]
    [&lt;ffffffffc1a9496e&gt;] rt2800usb_probe_hw+0xe/0x60 [rt2800usb]
    [&lt;ffffffffc1ae491a&gt;] rt2x00lib_probe_dev+0x21a/0x7d0 [rt2x00lib]
    [&lt;ffffffffc1b3b83e&gt;] rt2x00usb_probe+0x1be/0x980 [rt2x00usb]
    [&lt;ffffffffc05981e2&gt;] usb_probe_interface+0xe2/0x310 [usbcore]
    [&lt;ffffffffb13be2d5&gt;] really_probe+0x1a5/0x410
    [&lt;ffffffffb13be5c8&gt;] __driver_probe_device+0x78/0x180
    [&lt;ffffffffb13be6fe&gt;] driver_probe_device+0x1e/0x90
    [&lt;ffffffffb13be972&gt;] __driver_attach+0xd2/0x1c0
    [&lt;ffffffffb13bbc57&gt;] bus_for_each_dev+0x77/0xd0
    [&lt;ffffffffb13bd2a2&gt;] bus_add_driver+0x112/0x210
    [&lt;ffffffffb13bfc6c&gt;] driver_register+0x5c/0x120
    [&lt;ffffffffc0596ae8&gt;] usb_register_driver+0x88/0x150 [usbcore]
    [&lt;ffffffffb0c011c4&gt;] do_one_initcall+0x44/0x220
    [&lt;ffffffffb0d6134c&gt;] do_init_module+0x4c/0x220

Fix this by freeing the channel surveys on device removal.

Tested with a RT3070 based USB wireless adapter.

Fixes: 5447626910f5 ("rt2x00: save survey for every channel visited")
Signed-off-by: Armin Wolf &lt;W_Armin@gmx.de&gt;
Reviewed-by: Simon Horman &lt;simon.horman@corigine.com&gt;
Acked-by: Stanislaw Gruszka &lt;stf_xl@wp.pl&gt;
Signed-off-by: Kalle Valo &lt;kvalo@kernel.org&gt;
Link: https://lore.kernel.org/r/20230330215637.4332-1-W_Armin@gmx.de
</pre>
</div>
</content>
</entry>
<entry>
<title>wifi: rt2x00: add throughput LED trigger</title>
<updated>2022-09-24T12:30:54+00:00</updated>
<author>
<name>David Bauer</name>
<email>mail@david-bauer.net</email>
</author>
<published>2022-09-17T20:26:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=47c40fd2440e1e30f13fae3836df4658517813aa'/>
<id>47c40fd2440e1e30f13fae3836df4658517813aa</id>
<content type='text'>
This adds a (currently missing) throughput LED trigger for the rt2x00
driver. Previously, LED triggers had to be assigned to the netdev, which
was limited to a single VAP.

Tested-by: Christoph Krapp &lt;achterin@googlemail.com&gt;
Signed-off-by: David Bauer &lt;mail@david-bauer.net&gt;
Acked-by: Stanislaw Gruszka &lt;stf_xl@wp.pl&gt;
Signed-off-by: Daniel Golle &lt;daniel@makrotopia.org&gt;
Signed-off-by: Kalle Valo &lt;kvalo@kernel.org&gt;
Link: https://lore.kernel.org/r/73f5ba4134e621462a26186449400cf0c1ac1730.1663445157.git.daniel@makrotopia.org
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This adds a (currently missing) throughput LED trigger for the rt2x00
driver. Previously, LED triggers had to be assigned to the netdev, which
was limited to a single VAP.

Tested-by: Christoph Krapp &lt;achterin@googlemail.com&gt;
Signed-off-by: David Bauer &lt;mail@david-bauer.net&gt;
Acked-by: Stanislaw Gruszka &lt;stf_xl@wp.pl&gt;
Signed-off-by: Daniel Golle &lt;daniel@makrotopia.org&gt;
Signed-off-by: Kalle Valo &lt;kvalo@kernel.org&gt;
Link: https://lore.kernel.org/r/73f5ba4134e621462a26186449400cf0c1ac1730.1663445157.git.daniel@makrotopia.org
</pre>
</div>
</content>
</entry>
<entry>
<title>of: net: pass the dst buffer to of_get_mac_address()</title>
<updated>2021-04-13T21:35:02+00:00</updated>
<author>
<name>Michael Walle</name>
<email>michael@walle.cc</email>
</author>
<published>2021-04-12T17:47:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=83216e3988cd196183542937c9bd58b279f946af'/>
<id>83216e3988cd196183542937c9bd58b279f946af</id>
<content type='text'>
of_get_mac_address() returns a "const void*" pointer to a MAC address.
Lately, support to fetch the MAC address by an NVMEM provider was added.
But this will only work with platform devices. It will not work with
PCI devices (e.g. of an integrated root complex) and esp. not with DSA
ports.

There is an of_* variant of the nvmem binding which works without
devices. The returned data of a nvmem_cell_read() has to be freed after
use. On the other hand the return of_get_mac_address() points to some
static data without a lifetime. The trick for now, was to allocate a
device resource managed buffer which is then returned. This will only
work if we have an actual device.

Change it, so that the caller of of_get_mac_address() has to supply a
buffer where the MAC address is written to. Unfortunately, this will
touch all drivers which use the of_get_mac_address().

Usually the code looks like:

  const char *addr;
  addr = of_get_mac_address(np);
  if (!IS_ERR(addr))
    ether_addr_copy(ndev-&gt;dev_addr, addr);

This can then be simply rewritten as:

  of_get_mac_address(np, ndev-&gt;dev_addr);

Sometimes is_valid_ether_addr() is used to test the MAC address.
of_get_mac_address() already makes sure, it just returns a valid MAC
address. Thus we can just test its return code. But we have to be
careful if there are still other sources for the MAC address before the
of_get_mac_address(). In this case we have to keep the
is_valid_ether_addr() call.

The following coccinelle patch was used to convert common cases to the
new style. Afterwards, I've manually gone over the drivers and fixed the
return code variable: either used a new one or if one was already
available use that. Mansour Moufid, thanks for that coccinelle patch!

&lt;spml&gt;
@a@
identifier x;
expression y, z;
@@
- x = of_get_mac_address(y);
+ x = of_get_mac_address(y, z);
  &lt;...
- ether_addr_copy(z, x);
  ...&gt;

@@
identifier a.x;
@@
- if (&lt;+... x ...+&gt;) {}

@@
identifier a.x;
@@
  if (&lt;+... x ...+&gt;) {
      ...
  }
- else {}

@@
identifier a.x;
expression e;
@@
- if (&lt;+... x ...+&gt;@e)
-     {}
- else
+ if (!(e))
      {...}

@@
expression x, y, z;
@@
- x = of_get_mac_address(y, z);
+ of_get_mac_address(y, z);
  ... when != x
&lt;/spml&gt;

All drivers, except drivers/net/ethernet/aeroflex/greth.c, were
compile-time tested.

Suggested-by: Andrew Lunn &lt;andrew@lunn.ch&gt;
Signed-off-by: Michael Walle &lt;michael@walle.cc&gt;
Reviewed-by: Andrew Lunn &lt;andrew@lunn.ch&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
of_get_mac_address() returns a "const void*" pointer to a MAC address.
Lately, support to fetch the MAC address by an NVMEM provider was added.
But this will only work with platform devices. It will not work with
PCI devices (e.g. of an integrated root complex) and esp. not with DSA
ports.

There is an of_* variant of the nvmem binding which works without
devices. The returned data of a nvmem_cell_read() has to be freed after
use. On the other hand the return of_get_mac_address() points to some
static data without a lifetime. The trick for now, was to allocate a
device resource managed buffer which is then returned. This will only
work if we have an actual device.

Change it, so that the caller of of_get_mac_address() has to supply a
buffer where the MAC address is written to. Unfortunately, this will
touch all drivers which use the of_get_mac_address().

Usually the code looks like:

  const char *addr;
  addr = of_get_mac_address(np);
  if (!IS_ERR(addr))
    ether_addr_copy(ndev-&gt;dev_addr, addr);

This can then be simply rewritten as:

  of_get_mac_address(np, ndev-&gt;dev_addr);

Sometimes is_valid_ether_addr() is used to test the MAC address.
of_get_mac_address() already makes sure, it just returns a valid MAC
address. Thus we can just test its return code. But we have to be
careful if there are still other sources for the MAC address before the
of_get_mac_address(). In this case we have to keep the
is_valid_ether_addr() call.

The following coccinelle patch was used to convert common cases to the
new style. Afterwards, I've manually gone over the drivers and fixed the
return code variable: either used a new one or if one was already
available use that. Mansour Moufid, thanks for that coccinelle patch!

&lt;spml&gt;
@a@
identifier x;
expression y, z;
@@
- x = of_get_mac_address(y);
+ x = of_get_mac_address(y, z);
  &lt;...
- ether_addr_copy(z, x);
  ...&gt;

@@
identifier a.x;
@@
- if (&lt;+... x ...+&gt;) {}

@@
identifier a.x;
@@
  if (&lt;+... x ...+&gt;) {
      ...
  }
- else {}

@@
identifier a.x;
expression e;
@@
- if (&lt;+... x ...+&gt;@e)
-     {}
- else
+ if (!(e))
      {...}

@@
expression x, y, z;
@@
- x = of_get_mac_address(y, z);
+ of_get_mac_address(y, z);
  ... when != x
&lt;/spml&gt;

All drivers, except drivers/net/ethernet/aeroflex/greth.c, were
compile-time tested.

Suggested-by: Andrew Lunn &lt;andrew@lunn.ch&gt;
Signed-off-by: Michael Walle &lt;michael@walle.cc&gt;
Reviewed-by: Andrew Lunn &lt;andrew@lunn.ch&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rt2x00: remove WDS code</title>
<updated>2020-11-11T07:39:13+00:00</updated>
<author>
<name>Johannes Berg</name>
<email>johannes.berg@intel.com</email>
</author>
<published>2020-11-09T09:57:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=801a46bda516c4e3816d670e12022b95dffc02ea'/>
<id>801a46bda516c4e3816d670e12022b95dffc02ea</id>
<content type='text'>
The ability to reach this code was hidden behind
CONFIG_WIRELESS_WDS, which was just removed. Clean
up the driver accordingly.

Link: https://lore.kernel.org/r/20201109105103.c3248409e449.I74954b87e5bdd23c99a5314d2b265889292a6cb5@changeid
Acked-by: Kalle Valo &lt;kvalo@codeaurora.org&gt;
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The ability to reach this code was hidden behind
CONFIG_WIRELESS_WDS, which was just removed. Clean
up the driver accordingly.

Link: https://lore.kernel.org/r/20201109105103.c3248409e449.I74954b87e5bdd23c99a5314d2b265889292a6cb5@changeid
Acked-by: Kalle Valo &lt;kvalo@codeaurora.org&gt;
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rt2x00: convert tasklets to use new tasklet_setup() API</title>
<updated>2020-08-27T13:22:13+00:00</updated>
<author>
<name>Allen Pais</name>
<email>allen.lkml@gmail.com</email>
</author>
<published>2020-08-17T09:06:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=a0d6ea9b6e1cc4aef606bd8f3f098f7da4eb34d5'/>
<id>a0d6ea9b6e1cc4aef606bd8f3f098f7da4eb34d5</id>
<content type='text'>
In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Signed-off-by: Romain Perier &lt;romain.perier@gmail.com&gt;
Signed-off-by: Allen Pais &lt;allen.lkml@gmail.com&gt;
Signed-off-by: Kalle Valo &lt;kvalo@codeaurora.org&gt;
Link: https://lore.kernel.org/r/20200817090637.26887-15-allen.cryptic@gmail.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Signed-off-by: Romain Perier &lt;romain.perier@gmail.com&gt;
Signed-off-by: Allen Pais &lt;allen.lkml@gmail.com&gt;
Signed-off-by: Kalle Valo &lt;kvalo@codeaurora.org&gt;
Link: https://lore.kernel.org/r/20200817090637.26887-15-allen.cryptic@gmail.com
</pre>
</div>
</content>
</entry>
<entry>
<title>rt2x00: pci: use generic power management</title>
<updated>2020-08-02T15:13:45+00:00</updated>
<author>
<name>Vaibhav Gupta</name>
<email>vaibhavgupta40@gmail.com</email>
</author>
<published>2020-07-17T11:09:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=560a218d1ce6ea36df6fb943a1065181df90a4d6'/>
<id>560a218d1ce6ea36df6fb943a1065181df90a4d6</id>
<content type='text'>
Drivers using legacy PM have to manage PCI states and device's PM states
themselves. They also need to take care of configuration registers.

With improved and powerful support of generic PM, PCI Core takes care of
above mentioned, device-independent, jobs.

The callbacks make use of PCI helper functions like
pci_save/restore_state(), pci_enable/disable_device() and
pci_set_power_state() to do required operations. In generic mode, they are
no longer needed.

Change function parameter in both .suspend() and .resume() to
"struct device*" type. Use dev_get_drvdata() to get drv data.

The .suspend() callback is invoking rt2x00lib_suspend() which needs to be
modified as generic rt2x00pci_suspend() has no pm_message_t type argument,
passed to it, which is required by it according to its declaration.
Although this variable remained unused in the function body. Hence, remove
it from the function definition &amp; declaration.

rt2x00lib_suspend() is also invoked by rt2x00usb_suspend() and
rt2x00soc_suspend(). Thus, modify the functional call accordingly in their
function body.

Earlier, .suspend() &amp; .resume() were exported and were used by the
following drivers:
    - drivers/net/wireless/ralink/rt2x00/rt2400pci.c
    - drivers/net/wireless/ralink/rt2x00/rt2500pci.c
    - drivers/net/wireless/ralink/rt2x00/rt2800pci.c
    - drivers/net/wireless/ralink/rt2x00/rt61pci.c

Now, we only need to bind "struct dev_pm_ops" variable to
"struct pci_driver". Thus, make the callbacks static. Declare an
"extern const struct dev_pm_ops" variable and bind PM callbacks to it. Now,
export the variable instead and use it in respective drivers.

Compile-tested only.

Signed-off-by: Vaibhav Gupta &lt;vaibhavgupta40@gmail.com&gt;
Signed-off-by: Kalle Valo &lt;kvalo@codeaurora.org&gt;
Link: https://lore.kernel.org/r/20200717110928.454867-1-vaibhavgupta40@gmail.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Drivers using legacy PM have to manage PCI states and device's PM states
themselves. They also need to take care of configuration registers.

With improved and powerful support of generic PM, PCI Core takes care of
above mentioned, device-independent, jobs.

The callbacks make use of PCI helper functions like
pci_save/restore_state(), pci_enable/disable_device() and
pci_set_power_state() to do required operations. In generic mode, they are
no longer needed.

Change function parameter in both .suspend() and .resume() to
"struct device*" type. Use dev_get_drvdata() to get drv data.

The .suspend() callback is invoking rt2x00lib_suspend() which needs to be
modified as generic rt2x00pci_suspend() has no pm_message_t type argument,
passed to it, which is required by it according to its declaration.
Although this variable remained unused in the function body. Hence, remove
it from the function definition &amp; declaration.

rt2x00lib_suspend() is also invoked by rt2x00usb_suspend() and
rt2x00soc_suspend(). Thus, modify the functional call accordingly in their
function body.

Earlier, .suspend() &amp; .resume() were exported and were used by the
following drivers:
    - drivers/net/wireless/ralink/rt2x00/rt2400pci.c
    - drivers/net/wireless/ralink/rt2x00/rt2500pci.c
    - drivers/net/wireless/ralink/rt2x00/rt2800pci.c
    - drivers/net/wireless/ralink/rt2x00/rt61pci.c

Now, we only need to bind "struct dev_pm_ops" variable to
"struct pci_driver". Thus, make the callbacks static. Declare an
"extern const struct dev_pm_ops" variable and bind PM callbacks to it. Now,
export the variable instead and use it in respective drivers.

Compile-tested only.

Signed-off-by: Vaibhav Gupta &lt;vaibhavgupta40@gmail.com&gt;
Signed-off-by: Kalle Valo &lt;kvalo@codeaurora.org&gt;
Link: https://lore.kernel.org/r/20200717110928.454867-1-vaibhavgupta40@gmail.com
</pre>
</div>
</content>
</entry>
<entry>
<title>rt2x00: implement reconfig_complete</title>
<updated>2019-12-18T18:55:55+00:00</updated>
<author>
<name>Stanislaw Gruszka</name>
<email>sgruszka@redhat.com</email>
</author>
<published>2019-11-28T09:11:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=57f9807d1ea2bd1154d9f58c39670fbc49b1975e'/>
<id>57f9807d1ea2bd1154d9f58c39670fbc49b1975e</id>
<content type='text'>
mac80211 has .reconfig_complete that can be used as indicator of
HW restart end. This will allow to configure keys/IV differently
for HW restart and normal configuration.

Signed-off-by: Stanislaw Gruszka &lt;sgruszka@redhat.com&gt;
Signed-off-by: Kalle Valo &lt;kvalo@codeaurora.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
mac80211 has .reconfig_complete that can be used as indicator of
HW restart end. This will allow to configure keys/IV differently
for HW restart and normal configuration.

Signed-off-by: Stanislaw Gruszka &lt;sgruszka@redhat.com&gt;
Signed-off-by: Kalle Valo &lt;kvalo@codeaurora.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rt2x00: do not set IEEE80211_TX_STAT_AMPDU_NO_BACK on tx status</title>
<updated>2019-09-03T13:41:15+00:00</updated>
<author>
<name>Stanislaw Gruszka</name>
<email>sgruszka@redhat.com</email>
</author>
<published>2019-08-23T07:09:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=567a9b766b47caffe4b1bf74823e7bc18532d875'/>
<id>567a9b766b47caffe4b1bf74823e7bc18532d875</id>
<content type='text'>
According to documentation IEEE80211_TX_STAT_AMPDU_NO_BACK is suppose
to be used when we do not recive BA (BlockAck). However on rt2x00 we
use it when remote station fail to decode one or more subframes within
AMPDU (some bits are not set in BlockAck bitmap). Setting the flag result
in sent of BAR (BlockAck Request) frame and this might result of abuse
of BA session, since remote station can sent BA with incorrect
sequence numbers after receiving BAR. This problem is visible especially
when connecting two rt2800 devices.

Previously I observed some performance benefits when using the flag
when connecting with iwlwifi devices. But currently possibly due
to reacent changes in rt2x00 removing the flag has no effect on
those test cases.

So remove the IEEE80211_TX_STAT_AMPDU_NO_BACK.

Signed-off-by: Stanislaw Gruszka &lt;sgruszka@redhat.com&gt;
Signed-off-by: Kalle Valo &lt;kvalo@codeaurora.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
According to documentation IEEE80211_TX_STAT_AMPDU_NO_BACK is suppose
to be used when we do not recive BA (BlockAck). However on rt2x00 we
use it when remote station fail to decode one or more subframes within
AMPDU (some bits are not set in BlockAck bitmap). Setting the flag result
in sent of BAR (BlockAck Request) frame and this might result of abuse
of BA session, since remote station can sent BA with incorrect
sequence numbers after receiving BAR. This problem is visible especially
when connecting two rt2800 devices.

Previously I observed some performance benefits when using the flag
when connecting with iwlwifi devices. But currently possibly due
to reacent changes in rt2x00 removing the flag has no effect on
those test cases.

So remove the IEEE80211_TX_STAT_AMPDU_NO_BACK.

Signed-off-by: Stanislaw Gruszka &lt;sgruszka@redhat.com&gt;
Signed-off-by: Kalle Valo &lt;kvalo@codeaurora.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
