diff options
author | Michael Buesch <mb@bu3sch.de> | 2008-08-30 04:55:48 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-09-05 16:17:43 -0400 |
commit | e63e436326919dcc36e2bb242bc570257de70521 (patch) | |
tree | 37dd6b4c6637f0c94c38fdbdc6da4718c363ba56 /drivers/net | |
parent | 3d0da7516441d41dbfcc2b2667d9b792d580e50b (diff) |
b43: Add LP-PHY template
This adds template code for the LP-PHY.
No actual functionality is implemented.
Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/b43/Kconfig | 12 | ||||
-rw-r--r-- | drivers/net/wireless/b43/Makefile | 1 | ||||
-rw-r--r-- | drivers/net/wireless/b43/phy_common.c | 5 | ||||
-rw-r--r-- | drivers/net/wireless/b43/phy_common.h | 3 | ||||
-rw-r--r-- | drivers/net/wireless/b43/phy_lp.c | 142 | ||||
-rw-r--r-- | drivers/net/wireless/b43/phy_lp.h | 14 |
6 files changed, 176 insertions, 1 deletions
diff --git a/drivers/net/wireless/b43/Kconfig b/drivers/net/wireless/b43/Kconfig index 1fa043d1802c..1f81d36f87c5 100644 --- a/drivers/net/wireless/b43/Kconfig +++ b/drivers/net/wireless/b43/Kconfig | |||
@@ -80,6 +80,18 @@ config B43_NPHY | |||
80 | 80 | ||
81 | SAY N. | 81 | SAY N. |
82 | 82 | ||
83 | config B43_PHY_LP | ||
84 | bool "IEEE 802.11g LP-PHY support (BROKEN)" | ||
85 | depends on B43 && EXPERIMENTAL && BROKEN | ||
86 | ---help--- | ||
87 | Support for the LP-PHY. | ||
88 | The LP-PHY is an IEEE 802.11g based PHY built into some notebooks | ||
89 | and embedded devices. | ||
90 | |||
91 | THIS IS BROKEN AND DOES NOT WORK YET. | ||
92 | |||
93 | SAY N. | ||
94 | |||
83 | # This config option automatically enables b43 LEDS support, | 95 | # This config option automatically enables b43 LEDS support, |
84 | # if it's possible. | 96 | # if it's possible. |
85 | config B43_LEDS | 97 | config B43_LEDS |
diff --git a/drivers/net/wireless/b43/Makefile b/drivers/net/wireless/b43/Makefile index 7fe49034ff2b..14a02b3aea53 100644 --- a/drivers/net/wireless/b43/Makefile +++ b/drivers/net/wireless/b43/Makefile | |||
@@ -5,6 +5,7 @@ b43-y += phy_common.o | |||
5 | b43-y += phy_g.o | 5 | b43-y += phy_g.o |
6 | b43-y += phy_a.o | 6 | b43-y += phy_a.o |
7 | b43-$(CONFIG_B43_NPHY) += phy_n.o | 7 | b43-$(CONFIG_B43_NPHY) += phy_n.o |
8 | b43-$(CONFIG_B43_PHY_LP) += phy_lp.o | ||
8 | b43-y += sysfs.o | 9 | b43-y += sysfs.o |
9 | b43-y += xmit.o | 10 | b43-y += xmit.o |
10 | b43-y += lo.o | 11 | b43-y += lo.o |
diff --git a/drivers/net/wireless/b43/phy_common.c b/drivers/net/wireless/b43/phy_common.c index 4b6c944be042..b3762d8163c8 100644 --- a/drivers/net/wireless/b43/phy_common.c +++ b/drivers/net/wireless/b43/phy_common.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #include "phy_g.h" | 30 | #include "phy_g.h" |
31 | #include "phy_a.h" | 31 | #include "phy_a.h" |
32 | #include "phy_n.h" | 32 | #include "phy_n.h" |
33 | #include "phy_lp.h" | ||
33 | #include "b43.h" | 34 | #include "b43.h" |
34 | #include "main.h" | 35 | #include "main.h" |
35 | 36 | ||
@@ -54,7 +55,9 @@ int b43_phy_operations_setup(struct b43_wldev *dev) | |||
54 | #endif | 55 | #endif |
55 | break; | 56 | break; |
56 | case B43_PHYTYPE_LP: | 57 | case B43_PHYTYPE_LP: |
57 | /* FIXME: Not yet */ | 58 | #ifdef CONFIG_B43_PHY_LP |
59 | phy->ops = &b43_phyops_lp; | ||
60 | #endif | ||
58 | break; | 61 | break; |
59 | } | 62 | } |
60 | if (B43_WARN_ON(!phy->ops)) | 63 | if (B43_WARN_ON(!phy->ops)) |
diff --git a/drivers/net/wireless/b43/phy_common.h b/drivers/net/wireless/b43/phy_common.h index f8db9f40df5d..a876e169cc87 100644 --- a/drivers/net/wireless/b43/phy_common.h +++ b/drivers/net/wireless/b43/phy_common.h | |||
@@ -165,6 +165,7 @@ struct b43_phy_operations { | |||
165 | struct b43_phy_a; | 165 | struct b43_phy_a; |
166 | struct b43_phy_g; | 166 | struct b43_phy_g; |
167 | struct b43_phy_n; | 167 | struct b43_phy_n; |
168 | struct b43_phy_lp; | ||
168 | 169 | ||
169 | struct b43_phy { | 170 | struct b43_phy { |
170 | /* Hardware operation callbacks. */ | 171 | /* Hardware operation callbacks. */ |
@@ -185,6 +186,8 @@ struct b43_phy { | |||
185 | struct b43_phy_g *g; | 186 | struct b43_phy_g *g; |
186 | /* N-PHY specific information */ | 187 | /* N-PHY specific information */ |
187 | struct b43_phy_n *n; | 188 | struct b43_phy_n *n; |
189 | /* LP-PHY specific information */ | ||
190 | struct b43_phy_lp *lp; | ||
188 | }; | 191 | }; |
189 | 192 | ||
190 | /* Band support flags. */ | 193 | /* Band support flags. */ |
diff --git a/drivers/net/wireless/b43/phy_lp.c b/drivers/net/wireless/b43/phy_lp.c new file mode 100644 index 000000000000..be2a5191f480 --- /dev/null +++ b/drivers/net/wireless/b43/phy_lp.c | |||
@@ -0,0 +1,142 @@ | |||
1 | /* | ||
2 | |||
3 | Broadcom B43 wireless driver | ||
4 | IEEE 802.11g LP-PHY driver | ||
5 | |||
6 | Copyright (c) 2008 Michael Buesch <mb@bu3sch.de> | ||
7 | |||
8 | This program is free software; you can redistribute it and/or modify | ||
9 | it under the terms of the GNU General Public License as published by | ||
10 | the Free Software Foundation; either version 2 of the License, or | ||
11 | (at your option) any later version. | ||
12 | |||
13 | This program is distributed in the hope that it will be useful, | ||
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | GNU General Public License for more details. | ||
17 | |||
18 | You should have received a copy of the GNU General Public License | ||
19 | along with this program; see the file COPYING. If not, write to | ||
20 | the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, | ||
21 | Boston, MA 02110-1301, USA. | ||
22 | |||
23 | */ | ||
24 | |||
25 | #include "b43.h" | ||
26 | #include "phy_lp.h" | ||
27 | #include "phy_common.h" | ||
28 | |||
29 | |||
30 | static int b43_lpphy_op_allocate(struct b43_wldev *dev) | ||
31 | { | ||
32 | struct b43_phy_lp *lpphy; | ||
33 | |||
34 | lpphy = kzalloc(sizeof(*lpphy), GFP_KERNEL); | ||
35 | if (!lpphy) | ||
36 | return -ENOMEM; | ||
37 | dev->phy.lp = lpphy; | ||
38 | |||
39 | //TODO | ||
40 | |||
41 | return 0; | ||
42 | } | ||
43 | |||
44 | static int b43_lpphy_op_init(struct b43_wldev *dev) | ||
45 | { | ||
46 | struct b43_phy_lp *lpphy = dev->phy.lp; | ||
47 | |||
48 | //TODO | ||
49 | lpphy->initialised = 1; | ||
50 | |||
51 | return 0; | ||
52 | } | ||
53 | |||
54 | static void b43_lpphy_op_exit(struct b43_wldev *dev) | ||
55 | { | ||
56 | struct b43_phy_lp *lpphy = dev->phy.lp; | ||
57 | |||
58 | if (lpphy->initialised) { | ||
59 | //TODO | ||
60 | lpphy->initialised = 0; | ||
61 | } | ||
62 | |||
63 | kfree(lpphy); | ||
64 | dev->phy.lp = NULL; | ||
65 | } | ||
66 | |||
67 | static u16 b43_lpphy_op_read(struct b43_wldev *dev, u16 reg) | ||
68 | { | ||
69 | //TODO | ||
70 | return 0; | ||
71 | } | ||
72 | |||
73 | static void b43_lpphy_op_write(struct b43_wldev *dev, u16 reg, u16 value) | ||
74 | { | ||
75 | //TODO | ||
76 | } | ||
77 | |||
78 | static u16 b43_lpphy_op_radio_read(struct b43_wldev *dev, u16 reg) | ||
79 | { | ||
80 | //TODO | ||
81 | return 0; | ||
82 | } | ||
83 | |||
84 | static void b43_lpphy_op_radio_write(struct b43_wldev *dev, u16 reg, u16 value) | ||
85 | { | ||
86 | /* Register 1 is a 32-bit register. */ | ||
87 | B43_WARN_ON(reg == 1); | ||
88 | |||
89 | //TODO | ||
90 | } | ||
91 | |||
92 | static void b43_lpphy_op_software_rfkill(struct b43_wldev *dev, | ||
93 | enum rfkill_state state) | ||
94 | { | ||
95 | //TODO | ||
96 | } | ||
97 | |||
98 | static int b43_lpphy_op_switch_channel(struct b43_wldev *dev, | ||
99 | unsigned int new_channel) | ||
100 | { | ||
101 | //TODO | ||
102 | return 0; | ||
103 | } | ||
104 | |||
105 | static unsigned int b43_lpphy_op_get_default_chan(struct b43_wldev *dev) | ||
106 | { | ||
107 | return 1; /* Default to channel 1 */ | ||
108 | } | ||
109 | |||
110 | static void b43_lpphy_op_set_rx_antenna(struct b43_wldev *dev, int antenna) | ||
111 | { | ||
112 | //TODO | ||
113 | } | ||
114 | |||
115 | static void b43_lpphy_op_adjust_txpower(struct b43_wldev *dev) | ||
116 | { | ||
117 | //TODO | ||
118 | } | ||
119 | |||
120 | static enum b43_txpwr_result b43_lpphy_op_recalc_txpower(struct b43_wldev *dev, | ||
121 | bool ignore_tssi) | ||
122 | { | ||
123 | //TODO | ||
124 | return B43_TXPWR_RES_DONE; | ||
125 | } | ||
126 | |||
127 | |||
128 | const struct b43_phy_operations b43_phyops_lp = { | ||
129 | .allocate = b43_lpphy_op_allocate, | ||
130 | .init = b43_lpphy_op_init, | ||
131 | .exit = b43_lpphy_op_exit, | ||
132 | .phy_read = b43_lpphy_op_read, | ||
133 | .phy_write = b43_lpphy_op_write, | ||
134 | .radio_read = b43_lpphy_op_radio_read, | ||
135 | .radio_write = b43_lpphy_op_radio_write, | ||
136 | .software_rfkill = b43_lpphy_op_software_rfkill, | ||
137 | .switch_channel = b43_lpphy_op_switch_channel, | ||
138 | .get_default_chan = b43_lpphy_op_get_default_chan, | ||
139 | .set_rx_antenna = b43_lpphy_op_set_rx_antenna, | ||
140 | .recalc_txpower = b43_lpphy_op_recalc_txpower, | ||
141 | .adjust_txpower = b43_lpphy_op_adjust_txpower, | ||
142 | }; | ||
diff --git a/drivers/net/wireless/b43/phy_lp.h b/drivers/net/wireless/b43/phy_lp.h new file mode 100644 index 000000000000..e39a5436d8c0 --- /dev/null +++ b/drivers/net/wireless/b43/phy_lp.h | |||
@@ -0,0 +1,14 @@ | |||
1 | #ifndef LINUX_B43_PHY_LP_H_ | ||
2 | #define LINUX_B43_PHY_LP_H_ | ||
3 | |||
4 | /* Definitions for the LP-PHY */ | ||
5 | |||
6 | struct b43_phy_lp { | ||
7 | bool initialised; | ||
8 | }; | ||
9 | |||
10 | |||
11 | struct b43_phy_operations; | ||
12 | extern const struct b43_phy_operations b43_phyops_lp; | ||
13 | |||
14 | #endif /* LINUX_B43_PHY_LP_H_ */ | ||