wpa_supplicant 4.9G support

本文讨论了WPA Supplicant中的Channel处理算法存在的问题,并提出了一种改进方案来支持4.9GHz频段。通过调整算法逻辑,确保在不同频率下正确计算频道号,从而实现更广泛的无线网络兼容性和稳定性。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

https://android.googlesource.com/platform/external/wpa_supplicant_8/+/master/src/drivers/driver_nl80211.c


  1.                         /* crude heuristic */
  2.                         if (mode->channels[idx].freq < 4000)
  3.                                 if (mode->channels[idx].freq == 2484)
  4.                                         mode->channels[idx].chan = 14;
  5.                                 else
  6.                                         mode->channels[idx].chan = (mode->channels[idx].freq - 2407) / 5;
  7.                         else
  8.                                 mode->channels[idx].chan = mode->channels[idx].freq/5 - 1000;


this code should implement 4.9G support, if my wifi driver register 184 channel support, driver_nl80211.c will get negative channel,because of (4920/5) - 1000 = -16, i think this code should implement as following:

else if (mode->channel[idx].freq < 4999)
{
/* handle 4.9G */
/* 4920 -> 184 channel, 4940 -> 188 channel, 4960 -> 192 channel, 4980 -> 196 channel */
mode->channels[idx].chan = (mode->channels[idx].freq - 4000)/5;
}
else
{ /* handle 5G */
mode->channels[idx].chan = mode->channels[idx].freq/5 - 1000;
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值