phy_lp.c 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. /*
  2. Broadcom B43 wireless driver
  3. IEEE 802.11g LP-PHY driver
  4. Copyright (c) 2008 Michael Buesch <mb@bu3sch.de>
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; see the file COPYING. If not, write to
  15. the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor,
  16. Boston, MA 02110-1301, USA.
  17. */
  18. #include "b43.h"
  19. #include "phy_lp.h"
  20. #include "phy_common.h"
  21. static int b43_lpphy_op_allocate(struct b43_wldev *dev)
  22. {
  23. struct b43_phy_lp *lpphy;
  24. lpphy = kzalloc(sizeof(*lpphy), GFP_KERNEL);
  25. if (!lpphy)
  26. return -ENOMEM;
  27. dev->phy.lp = lpphy;
  28. //TODO
  29. return 0;
  30. }
  31. static int b43_lpphy_op_init(struct b43_wldev *dev)
  32. {
  33. struct b43_phy_lp *lpphy = dev->phy.lp;
  34. //TODO
  35. lpphy->initialised = 1;
  36. return 0;
  37. }
  38. static void b43_lpphy_op_exit(struct b43_wldev *dev)
  39. {
  40. struct b43_phy_lp *lpphy = dev->phy.lp;
  41. if (lpphy->initialised) {
  42. //TODO
  43. lpphy->initialised = 0;
  44. }
  45. kfree(lpphy);
  46. dev->phy.lp = NULL;
  47. }
  48. static u16 b43_lpphy_op_read(struct b43_wldev *dev, u16 reg)
  49. {
  50. //TODO
  51. return 0;
  52. }
  53. static void b43_lpphy_op_write(struct b43_wldev *dev, u16 reg, u16 value)
  54. {
  55. //TODO
  56. }
  57. static u16 b43_lpphy_op_radio_read(struct b43_wldev *dev, u16 reg)
  58. {
  59. //TODO
  60. return 0;
  61. }
  62. static void b43_lpphy_op_radio_write(struct b43_wldev *dev, u16 reg, u16 value)
  63. {
  64. /* Register 1 is a 32-bit register. */
  65. B43_WARN_ON(reg == 1);
  66. //TODO
  67. }
  68. static void b43_lpphy_op_software_rfkill(struct b43_wldev *dev,
  69. enum rfkill_state state)
  70. {
  71. //TODO
  72. }
  73. static int b43_lpphy_op_switch_channel(struct b43_wldev *dev,
  74. unsigned int new_channel)
  75. {
  76. //TODO
  77. return 0;
  78. }
  79. static unsigned int b43_lpphy_op_get_default_chan(struct b43_wldev *dev)
  80. {
  81. return 1; /* Default to channel 1 */
  82. }
  83. static void b43_lpphy_op_set_rx_antenna(struct b43_wldev *dev, int antenna)
  84. {
  85. //TODO
  86. }
  87. static void b43_lpphy_op_adjust_txpower(struct b43_wldev *dev)
  88. {
  89. //TODO
  90. }
  91. static enum b43_txpwr_result b43_lpphy_op_recalc_txpower(struct b43_wldev *dev,
  92. bool ignore_tssi)
  93. {
  94. //TODO
  95. return B43_TXPWR_RES_DONE;
  96. }
  97. const struct b43_phy_operations b43_phyops_lp = {
  98. .allocate = b43_lpphy_op_allocate,
  99. .init = b43_lpphy_op_init,
  100. .exit = b43_lpphy_op_exit,
  101. .phy_read = b43_lpphy_op_read,
  102. .phy_write = b43_lpphy_op_write,
  103. .radio_read = b43_lpphy_op_radio_read,
  104. .radio_write = b43_lpphy_op_radio_write,
  105. .software_rfkill = b43_lpphy_op_software_rfkill,
  106. .switch_channel = b43_lpphy_op_switch_channel,
  107. .get_default_chan = b43_lpphy_op_get_default_chan,
  108. .set_rx_antenna = b43_lpphy_op_set_rx_antenna,
  109. .recalc_txpower = b43_lpphy_op_recalc_txpower,
  110. .adjust_txpower = b43_lpphy_op_adjust_txpower,
  111. };