014-fix-band-reporting.patch 822 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. --- a/driver/wl_iw.c
  2. +++ b/driver/wl_iw.c
  3. @@ -314,7 +314,7 @@ wl_iw_get_name(
  4. )
  5. {
  6. int phytype, err;
  7. - uint band[3];
  8. + uint i, band[3], bands;
  9. char cap[5];
  10. WL_TRACE(("%s: SIOCGIWNAME\n", dev->name));
  11. @@ -335,16 +335,20 @@ wl_iw_get_name(
  12. break;
  13. case WLC_PHY_TYPE_LP:
  14. case WLC_PHY_TYPE_G:
  15. - if (band[0] >= 2)
  16. - strcpy(cap, "abg");
  17. - else
  18. - strcpy(cap, "bg");
  19. - break;
  20. case WLC_PHY_TYPE_N:
  21. - if (band[0] >= 2)
  22. - strcpy(cap, "abgn");
  23. - else
  24. - strcpy(cap, "bgn");
  25. + bands = 0;
  26. + for (i = 1; i <= band[0]; i++) {
  27. + bands |= dtoh32(band[i]);
  28. + }
  29. + strcpy(cap, "");
  30. + if (bands & WLC_BAND_5G)
  31. + strcat(cap, "a");
  32. + if (bands & WLC_BAND_2G)
  33. + strcat(cap, "bg");
  34. + if (phytype == WLC_PHY_TYPE_N)
  35. + strcat(cap, "n");
  36. + break;
  37. + default:
  38. break;
  39. }
  40. done: