wpa_supplicant 4.9G support

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;
}

你可能感兴趣的:(Google,Android,space)