aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/b43/Kconfig8
-rw-r--r--drivers/net/wireless/b43/Makefile1
-rw-r--r--drivers/net/wireless/b43/main.c10
-rw-r--r--drivers/net/wireless/b43/phy_common.c6
-rw-r--r--drivers/net/wireless/b43/phy_common.h3
-rw-r--r--drivers/net/wireless/b43/phy_ht.c119
-rw-r--r--drivers/net/wireless/b43/phy_ht.h19
7 files changed, 166 insertions, 0 deletions
diff --git a/drivers/net/wireless/b43/Kconfig b/drivers/net/wireless/b43/Kconfig
index fe26bf448fdb..e02db1be1723 100644
--- a/drivers/net/wireless/b43/Kconfig
+++ b/drivers/net/wireless/b43/Kconfig
@@ -112,6 +112,14 @@ config B43_PHY_LP
112 and embedded devices. It supports 802.11a/g 112 and embedded devices. It supports 802.11a/g
113 (802.11a support is optional, and currently disabled). 113 (802.11a support is optional, and currently disabled).
114 114
115config B43_PHY_HT
116 bool "Support for HT-PHY devices (BROKEN)"
117 depends on B43 && BROKEN
118 ---help---
119 Support for the HT-PHY.
120
121 Say N, this is BROKEN and crashes driver.
122
115# This config option automatically enables b43 LEDS support, 123# This config option automatically enables b43 LEDS support,
116# if it's possible. 124# if it's possible.
117config B43_LEDS 125config B43_LEDS
diff --git a/drivers/net/wireless/b43/Makefile b/drivers/net/wireless/b43/Makefile
index 95f7c001fda1..58d614a889b9 100644
--- a/drivers/net/wireless/b43/Makefile
+++ b/drivers/net/wireless/b43/Makefile
@@ -10,6 +10,7 @@ b43-y += phy_a.o
10b43-$(CONFIG_B43_PHY_N) += phy_n.o 10b43-$(CONFIG_B43_PHY_N) += phy_n.o
11b43-$(CONFIG_B43_PHY_LP) += phy_lp.o 11b43-$(CONFIG_B43_PHY_LP) += phy_lp.o
12b43-$(CONFIG_B43_PHY_LP) += tables_lpphy.o 12b43-$(CONFIG_B43_PHY_LP) += tables_lpphy.o
13b43-$(CONFIG_B43_PHY_HT) += phy_ht.o
13b43-y += sysfs.o 14b43-y += sysfs.o
14b43-y += xmit.o 15b43-y += xmit.o
15b43-y += lo.o 16b43-y += lo.o
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index 7aed9a0eabc4..acee7b6af29a 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -4097,6 +4097,12 @@ static int b43_phy_versioning(struct b43_wldev *dev)
4097 unsupported = 1; 4097 unsupported = 1;
4098 break; 4098 break;
4099#endif 4099#endif
4100#ifdef CONFIG_B43_PHY_HT
4101 case B43_PHYTYPE_HT:
4102 if (phy_rev > 1)
4103 unsupported = 1;
4104 break;
4105#endif
4100 default: 4106 default:
4101 unsupported = 1; 4107 unsupported = 1;
4102 }; 4108 };
@@ -4153,6 +4159,10 @@ static int b43_phy_versioning(struct b43_wldev *dev)
4153 if (radio_ver != 0x2062 && radio_ver != 0x2063) 4159 if (radio_ver != 0x2062 && radio_ver != 0x2063)
4154 unsupported = 1; 4160 unsupported = 1;
4155 break; 4161 break;
4162 case B43_PHYTYPE_HT:
4163 if (radio_ver != 0x2059)
4164 unsupported = 1;
4165 break;
4156 default: 4166 default:
4157 B43_WARN_ON(1); 4167 B43_WARN_ON(1);
4158 } 4168 }
diff --git a/drivers/net/wireless/b43/phy_common.c b/drivers/net/wireless/b43/phy_common.c
index 425af28ea4e5..9705950f059a 100644
--- a/drivers/net/wireless/b43/phy_common.c
+++ b/drivers/net/wireless/b43/phy_common.c
@@ -31,6 +31,7 @@
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 "phy_lp.h"
34#include "phy_ht.h"
34#include "b43.h" 35#include "b43.h"
35#include "main.h" 36#include "main.h"
36 37
@@ -59,6 +60,11 @@ int b43_phy_allocate(struct b43_wldev *dev)
59 phy->ops = &b43_phyops_lp; 60 phy->ops = &b43_phyops_lp;
60#endif 61#endif
61 break; 62 break;
63 case B43_PHYTYPE_HT:
64#ifdef CONFIG_B43_PHY_HT
65 phy->ops = &b43_phyops_ht;
66#endif
67 break;
62 } 68 }
63 if (B43_WARN_ON(!phy->ops)) 69 if (B43_WARN_ON(!phy->ops))
64 return -ENODEV; 70 return -ENODEV;
diff --git a/drivers/net/wireless/b43/phy_common.h b/drivers/net/wireless/b43/phy_common.h
index 2401bee8b081..47dcb800a3c3 100644
--- a/drivers/net/wireless/b43/phy_common.h
+++ b/drivers/net/wireless/b43/phy_common.h
@@ -194,6 +194,7 @@ struct b43_phy_a;
194struct b43_phy_g; 194struct b43_phy_g;
195struct b43_phy_n; 195struct b43_phy_n;
196struct b43_phy_lp; 196struct b43_phy_lp;
197struct b43_phy_ht;
197 198
198struct b43_phy { 199struct b43_phy {
199 /* Hardware operation callbacks. */ 200 /* Hardware operation callbacks. */
@@ -216,6 +217,8 @@ struct b43_phy {
216 struct b43_phy_n *n; 217 struct b43_phy_n *n;
217 /* LP-PHY specific information */ 218 /* LP-PHY specific information */
218 struct b43_phy_lp *lp; 219 struct b43_phy_lp *lp;
220 /* HT-PHY specific information */
221 struct b43_phy_ht *ht;
219 }; 222 };
220 223
221 /* Band support flags. */ 224 /* Band support flags. */
diff --git a/drivers/net/wireless/b43/phy_ht.c b/drivers/net/wireless/b43/phy_ht.c
new file mode 100644
index 000000000000..320be0eeaf37
--- /dev/null
+++ b/drivers/net/wireless/b43/phy_ht.c
@@ -0,0 +1,119 @@
1/*
2
3 Broadcom B43 wireless driver
4 IEEE 802.11n HT-PHY support
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; see the file COPYING. If not, write to
18 the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor,
19 Boston, MA 02110-1301, USA.
20
21*/
22
23#include <linux/slab.h>
24
25#include "b43.h"
26#include "phy_ht.h"
27#include "main.h"
28
29/**************************************************
30 * Basic PHY ops.
31 **************************************************/
32
33static int b43_phy_ht_op_allocate(struct b43_wldev *dev)
34{
35 struct b43_phy_ht *phy_ht;
36
37 phy_ht = kzalloc(sizeof(*phy_ht), GFP_KERNEL);
38 if (!phy_ht)
39 return -ENOMEM;
40 dev->phy.ht = phy_ht;
41
42 return 0;
43}
44
45static void b43_phy_ht_op_prepare_structs(struct b43_wldev *dev)
46{
47 struct b43_phy *phy = &dev->phy;
48 struct b43_phy_ht *phy_ht = phy->ht;
49
50 memset(phy_ht, 0, sizeof(*phy_ht));
51}
52
53static void b43_phy_ht_op_free(struct b43_wldev *dev)
54{
55 struct b43_phy *phy = &dev->phy;
56 struct b43_phy_ht *phy_ht = phy->ht;
57
58 kfree(phy_ht);
59 phy->ht = NULL;
60}
61
62static unsigned int b43_phy_ht_op_get_default_chan(struct b43_wldev *dev)
63{
64 if (b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ)
65 return 1;
66 return 36;
67}
68
69/**************************************************
70 * R/W ops.
71 **************************************************/
72
73static u16 b43_phy_ht_op_read(struct b43_wldev *dev, u16 reg)
74{
75 b43_write16(dev, B43_MMIO_PHY_CONTROL, reg);
76 return b43_read16(dev, B43_MMIO_PHY_DATA);
77}
78
79static void b43_phy_ht_op_write(struct b43_wldev *dev, u16 reg, u16 value)
80{
81 b43_write16(dev, B43_MMIO_PHY_CONTROL, reg);
82 b43_write16(dev, B43_MMIO_PHY_DATA, value);
83}
84
85static void b43_phy_ht_op_maskset(struct b43_wldev *dev, u16 reg, u16 mask,
86 u16 set)
87{
88 b43_write16(dev, B43_MMIO_PHY_CONTROL, reg);
89 b43_write16(dev, B43_MMIO_PHY_DATA,
90 (b43_read16(dev, B43_MMIO_PHY_DATA) & mask) | set);
91}
92
93/**************************************************
94 * PHY ops struct.
95 **************************************************/
96
97const struct b43_phy_operations b43_phyops_ht = {
98 .allocate = b43_phy_ht_op_allocate,
99 .free = b43_phy_ht_op_free,
100 .prepare_structs = b43_phy_ht_op_prepare_structs,
101 /*
102 .init = b43_phy_ht_op_init,
103 */
104 .phy_read = b43_phy_ht_op_read,
105 .phy_write = b43_phy_ht_op_write,
106 .phy_maskset = b43_phy_ht_op_maskset,
107 /*
108 .radio_read = b43_phy_ht_op_radio_read,
109 .radio_write = b43_phy_ht_op_radio_write,
110 .software_rfkill = b43_phy_ht_op_software_rfkill,
111 .switch_analog = b43_phy_ht_op_switch_analog,
112 .switch_channel = b43_phy_ht_op_switch_channel,
113 */
114 .get_default_chan = b43_phy_ht_op_get_default_chan,
115 /*
116 .recalc_txpower = b43_phy_ht_op_recalc_txpower,
117 .adjust_txpower = b43_phy_ht_op_adjust_txpower,
118 */
119};
diff --git a/drivers/net/wireless/b43/phy_ht.h b/drivers/net/wireless/b43/phy_ht.h
new file mode 100644
index 000000000000..aabad6f22941
--- /dev/null
+++ b/drivers/net/wireless/b43/phy_ht.h
@@ -0,0 +1,19 @@
1#ifndef B43_PHY_HT_H_
2#define B43_PHY_HT_H_
3
4#include "phy_common.h"
5
6
7#define B43_PHY_HT_TABLE_ADDR 0x072 /* Table address */
8#define B43_PHY_HT_TABLE_DATALO 0x073 /* Table data low */
9#define B43_PHY_HT_TABLE_DATAHI 0x074 /* Table data high */
10
11
12struct b43_phy_ht {
13};
14
15
16struct b43_phy_operations;
17extern const struct b43_phy_operations b43_phyops_ht;
18
19#endif /* B43_PHY_HT_H_ */