Re: [PATCH v3 3/3] netdev: fall back to RSSI polling if SET_CQM fails

Denis Kenzior
2024-09-03T15:15:40Z

Hi James,

On 8/29/24 6:41 AM, James Prestwood wrote:
> Some drivers fail to set a CQM threshold and report not supported.
> Its unclear exactly why but if this happens roaming is effectively
> broken.
>
> To work around this enable RSSI polling if -ENOTSUP is returned.
> The polling callback has been changed to emit the HIGH/LOW signal
> threshold events instead of just the RSSI level index, just as if
> a CQM event came from the kernel.
> ---
> src/netdev.c | 142 ++++++++++++++++++++++++++++++++++-----------------
> 1 file changed, 94 insertions(+), 48 deletions(-)
>
> v3:
> * Rebaed on top of upstream
>

<snip>

> @@ -3672,7 +3718,7 @@ static int netdev_cqm_rssi_update(struct netdev *netdev)
> return -EINVAL;
>
> if (!l_genl_family_send(nl80211, msg, netdev_cmd_set_cqm_cb,
> - NULL, NULL)) {
> + netdev, NULL)) {
> l_genl_msg_unref(msg);
> return -EIO;
> }
> @@ -5310,7 +5356,7 @@ int netdev_set_rssi_report_levels(struct netdev *netdev, const int8_t *levels,
> return -EINVAL;
>
> if (!l_genl_family_send(nl80211, cmd_set_cqm, netdev_cmd_set_cqm_cb,
> - NULL, NULL)) {
> + netdev, NULL)) {
> l_genl_msg_unref(cmd_set_cqm);
> return -EIO;
> }

Since userdata is now used in these l_genl_family_send callbacks, you really
should track the command id in case netdev gets removed. Alternatively, switch
netdev to start using a dedicated l_genl_family handle so that all outstanding
requests get auto-canceled.

Regards,
-Denis