phy_lcn.c 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. /*
  2. Broadcom B43 wireless driver
  3. IEEE 802.11n LCN-PHY support
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; see the file COPYING. If not, write to
  14. the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor,
  15. Boston, MA 02110-1301, USA.
  16. */
  17. #include <linux/slab.h>
  18. #include "b43.h"
  19. #include "phy_lcn.h"
  20. #include "tables_phy_lcn.h"
  21. #include "main.h"
  22. /**************************************************
  23. * Basic PHY ops.
  24. **************************************************/
  25. static int b43_phy_lcn_op_allocate(struct b43_wldev *dev)
  26. {
  27. struct b43_phy_lcn *phy_lcn;
  28. phy_lcn = kzalloc(sizeof(*phy_lcn), GFP_KERNEL);
  29. if (!phy_lcn)
  30. return -ENOMEM;
  31. dev->phy.lcn = phy_lcn;
  32. return 0;
  33. }
  34. static void b43_phy_lcn_op_free(struct b43_wldev *dev)
  35. {
  36. struct b43_phy *phy = &dev->phy;
  37. struct b43_phy_lcn *phy_lcn = phy->lcn;
  38. kfree(phy_lcn);
  39. phy->lcn = NULL;
  40. }
  41. static void b43_phy_lcn_op_prepare_structs(struct b43_wldev *dev)
  42. {
  43. struct b43_phy *phy = &dev->phy;
  44. struct b43_phy_lcn *phy_lcn = phy->lcn;
  45. memset(phy_lcn, 0, sizeof(*phy_lcn));
  46. }
  47. static unsigned int b43_phy_lcn_op_get_default_chan(struct b43_wldev *dev)
  48. {
  49. if (b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ)
  50. return 1;
  51. return 36;
  52. }
  53. static enum b43_txpwr_result
  54. b43_phy_lcn_op_recalc_txpower(struct b43_wldev *dev, bool ignore_tssi)
  55. {
  56. return B43_TXPWR_RES_DONE;
  57. }
  58. static void b43_phy_lcn_op_adjust_txpower(struct b43_wldev *dev)
  59. {
  60. }
  61. /**************************************************
  62. * PHY ops struct.
  63. **************************************************/
  64. const struct b43_phy_operations b43_phyops_lcn = {
  65. .allocate = b43_phy_lcn_op_allocate,
  66. .free = b43_phy_lcn_op_free,
  67. .prepare_structs = b43_phy_lcn_op_prepare_structs,
  68. /*
  69. .init = b43_phy_lcn_op_init,
  70. .phy_read = b43_phy_lcn_op_read,
  71. .phy_write = b43_phy_lcn_op_write,
  72. .phy_maskset = b43_phy_lcn_op_maskset,
  73. .radio_read = b43_phy_lcn_op_radio_read,
  74. .radio_write = b43_phy_lcn_op_radio_write,
  75. .software_rfkill = b43_phy_lcn_op_software_rfkill,
  76. .switch_analog = b43_phy_lcn_op_switch_analog,
  77. .switch_channel = b43_phy_lcn_op_switch_channel,
  78. */
  79. .get_default_chan = b43_phy_lcn_op_get_default_chan,
  80. .recalc_txpower = b43_phy_lcn_op_recalc_txpower,
  81. .adjust_txpower = b43_phy_lcn_op_adjust_txpower,
  82. };