aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/b43
diff options
context:
space:
mode:
authorRafał Miłecki <zajec5@gmail.com>2011-08-14 17:27:28 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-08-24 14:41:41 -0400
commitf928668f2d822ec51c0853fc92f4da2fef376958 (patch)
treef986be52beda38434334d90c027eaa08667af724 /drivers/net/wireless/b43
parent0cc9772a6bd8002aaf7583194098e92481d9c7f1 (diff)
b43: LCN-PHY: add very basic PHY ops
Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/b43')
-rw-r--r--drivers/net/wireless/b43/phy_lcn.c54
-rw-r--r--drivers/net/wireless/b43/phy_lcn.h2
2 files changed, 53 insertions, 3 deletions
diff --git a/drivers/net/wireless/b43/phy_lcn.c b/drivers/net/wireless/b43/phy_lcn.c
index 9f7dbbd5ced6..03944ad13cfb 100644
--- a/drivers/net/wireless/b43/phy_lcn.c
+++ b/drivers/net/wireless/b43/phy_lcn.c
@@ -28,14 +28,64 @@
28#include "main.h" 28#include "main.h"
29 29
30/************************************************** 30/**************************************************
31 * Basic PHY ops.
32 **************************************************/
33
34static int b43_phy_lcn_op_allocate(struct b43_wldev *dev)
35{
36 struct b43_phy_lcn *phy_lcn;
37
38 phy_lcn = kzalloc(sizeof(*phy_lcn), GFP_KERNEL);
39 if (!phy_lcn)
40 return -ENOMEM;
41 dev->phy.lcn = phy_lcn;
42
43 return 0;
44}
45
46static void b43_phy_lcn_op_free(struct b43_wldev *dev)
47{
48 struct b43_phy *phy = &dev->phy;
49 struct b43_phy_lcn *phy_lcn = phy->lcn;
50
51 kfree(phy_lcn);
52 phy->lcn = NULL;
53}
54
55static void b43_phy_lcn_op_prepare_structs(struct b43_wldev *dev)
56{
57 struct b43_phy *phy = &dev->phy;
58 struct b43_phy_lcn *phy_lcn = phy->lcn;
59
60 memset(phy_lcn, 0, sizeof(*phy_lcn));
61}
62
63static unsigned int b43_phy_lcn_op_get_default_chan(struct b43_wldev *dev)
64{
65 if (b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ)
66 return 1;
67 return 36;
68}
69
70static enum b43_txpwr_result
71b43_phy_lcn_op_recalc_txpower(struct b43_wldev *dev, bool ignore_tssi)
72{
73 return B43_TXPWR_RES_DONE;
74}
75
76static void b43_phy_lcn_op_adjust_txpower(struct b43_wldev *dev)
77{
78}
79
80/**************************************************
31 * PHY ops struct. 81 * PHY ops struct.
32 **************************************************/ 82 **************************************************/
33 83
34const struct b43_phy_operations b43_phyops_lcn = { 84const struct b43_phy_operations b43_phyops_lcn = {
35 /*
36 .allocate = b43_phy_lcn_op_allocate, 85 .allocate = b43_phy_lcn_op_allocate,
37 .free = b43_phy_lcn_op_free, 86 .free = b43_phy_lcn_op_free,
38 .prepare_structs = b43_phy_lcn_op_prepare_structs, 87 .prepare_structs = b43_phy_lcn_op_prepare_structs,
88 /*
39 .init = b43_phy_lcn_op_init, 89 .init = b43_phy_lcn_op_init,
40 .phy_read = b43_phy_lcn_op_read, 90 .phy_read = b43_phy_lcn_op_read,
41 .phy_write = b43_phy_lcn_op_write, 91 .phy_write = b43_phy_lcn_op_write,
@@ -45,8 +95,8 @@ const struct b43_phy_operations b43_phyops_lcn = {
45 .software_rfkill = b43_phy_lcn_op_software_rfkill, 95 .software_rfkill = b43_phy_lcn_op_software_rfkill,
46 .switch_analog = b43_phy_lcn_op_switch_analog, 96 .switch_analog = b43_phy_lcn_op_switch_analog,
47 .switch_channel = b43_phy_lcn_op_switch_channel, 97 .switch_channel = b43_phy_lcn_op_switch_channel,
98 */
48 .get_default_chan = b43_phy_lcn_op_get_default_chan, 99 .get_default_chan = b43_phy_lcn_op_get_default_chan,
49 .recalc_txpower = b43_phy_lcn_op_recalc_txpower, 100 .recalc_txpower = b43_phy_lcn_op_recalc_txpower,
50 .adjust_txpower = b43_phy_lcn_op_adjust_txpower, 101 .adjust_txpower = b43_phy_lcn_op_adjust_txpower,
51 */
52}; 102};
diff --git a/drivers/net/wireless/b43/phy_lcn.h b/drivers/net/wireless/b43/phy_lcn.h
index c046c2a6cab4..9e1b291cca38 100644
--- a/drivers/net/wireless/b43/phy_lcn.h
+++ b/drivers/net/wireless/b43/phy_lcn.h
@@ -11,4 +11,4 @@ struct b43_phy_lcn {
11struct b43_phy_operations; 11struct b43_phy_operations;
12extern const struct b43_phy_operations b43_phyops_lcn; 12extern const struct b43_phy_operations b43_phyops_lcn;
13 13
14#endif /* B43_PHY_LCN_H_ */ \ No newline at end of file 14#endif /* B43_PHY_LCN_H_ */