1 Subject: mac80211: kill hw.conf.antenna_sel_{rx,tx}
5 Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
7 drivers/net/wireless/b43/main.c | 25 +++----------------------
8 drivers/net/wireless/b43legacy/main.c | 18 ++----------------
9 drivers/net/wireless/p54/p54common.c | 3 +--
10 drivers/net/wireless/rt2x00/rt2x00config.c | 20 ++++----------------
11 drivers/net/wireless/rt2x00/rt2x00dev.c | 6 ++----
12 include/net/mac80211.h | 7 +------
13 net/mac80211/debugfs.c | 8 --------
14 net/mac80211/ieee80211_i.h | 2 --
15 net/mac80211/tx.c | 1 -
16 9 files changed, 13 insertions(+), 77 deletions(-)
18 --- everything.orig/net/mac80211/debugfs.c 2008-10-08 22:35:20.000000000 +0200
19 +++ everything/net/mac80211/debugfs.c 2008-10-08 22:35:26.000000000 +0200
20 @@ -47,10 +47,6 @@ static const struct file_operations name
22 DEBUGFS_READONLY_FILE(frequency, 20, "%d",
23 local->hw.conf.channel->center_freq);
24 -DEBUGFS_READONLY_FILE(antenna_sel_tx, 20, "%d",
25 - local->hw.conf.antenna_sel_tx);
26 -DEBUGFS_READONLY_FILE(antenna_sel_rx, 20, "%d",
27 - local->hw.conf.antenna_sel_rx);
28 DEBUGFS_READONLY_FILE(rts_threshold, 20, "%d",
29 local->rts_threshold);
30 DEBUGFS_READONLY_FILE(fragmentation_threshold, 20, "%d",
31 @@ -202,8 +198,6 @@ void debugfs_hw_add(struct ieee80211_loc
32 local->debugfs.keys = debugfs_create_dir("keys", phyd);
34 DEBUGFS_ADD(frequency);
35 - DEBUGFS_ADD(antenna_sel_tx);
36 - DEBUGFS_ADD(antenna_sel_rx);
37 DEBUGFS_ADD(rts_threshold);
38 DEBUGFS_ADD(fragmentation_threshold);
39 DEBUGFS_ADD(short_retry_limit);
40 @@ -258,8 +252,6 @@ void debugfs_hw_add(struct ieee80211_loc
41 void debugfs_hw_del(struct ieee80211_local *local)
43 DEBUGFS_DEL(frequency);
44 - DEBUGFS_DEL(antenna_sel_tx);
45 - DEBUGFS_DEL(antenna_sel_rx);
46 DEBUGFS_DEL(rts_threshold);
47 DEBUGFS_DEL(fragmentation_threshold);
48 DEBUGFS_DEL(short_retry_limit);
49 --- everything.orig/net/mac80211/ieee80211_i.h 2008-10-08 22:35:01.000000000 +0200
50 +++ everything/net/mac80211/ieee80211_i.h 2008-10-08 22:35:10.000000000 +0200
51 @@ -727,8 +727,6 @@ struct ieee80211_local {
53 struct dentry *rcname;
54 struct dentry *frequency;
55 - struct dentry *antenna_sel_tx;
56 - struct dentry *antenna_sel_rx;
57 struct dentry *rts_threshold;
58 struct dentry *fragmentation_threshold;
59 struct dentry *short_retry_limit;
60 --- everything.orig/include/net/mac80211.h 2008-10-08 22:35:30.000000000 +0200
61 +++ everything/include/net/mac80211.h 2008-10-08 22:39:56.000000000 +0200
62 @@ -324,7 +324,7 @@ struct ieee80211_tx_altrate {
63 * @flags: transmit info flags, defined above
66 - * @antenna_sel_tx: TBD
67 + * @antenna_sel_tx: antenna to use, 0 for automatic diversity
68 * @control: union for control data
69 * @status: union for status data
70 * @driver_data: array of driver_data pointers
71 @@ -474,9 +474,6 @@ static inline int __deprecated __IEEE802
72 * @listen_interval: listen interval in units of beacon interval
73 * @flags: configuration flags defined above
74 * @power_level: requested transmit power (in dBm)
75 - * @antenna_sel_tx: transmit antenna selection, 0: default/diversity,
77 - * @antenna_sel_rx: receive antenna selection, like @antenna_sel_tx
78 * @ht_cap: describes current self configuration of 802.11n HT capabilities
79 * @ht_bss_conf: describes current BSS configuration of 802.11n HT parameters
80 * @channel: the channel to tune to
81 @@ -488,8 +485,6 @@ struct ieee80211_conf {
88 struct ieee80211_channel *channel;
90 --- everything.orig/net/mac80211/tx.c 2008-10-08 22:37:05.000000000 +0200
91 +++ everything/net/mac80211/tx.c 2008-10-08 22:37:22.000000000 +0200
92 @@ -1975,7 +1975,6 @@ struct sk_buff *ieee80211_beacon_get(str
93 sband->bitrates[rsel.rate_idx].flags & IEEE80211_RATE_SHORT_PREAMBLE)
94 info->flags |= IEEE80211_TX_CTL_SHORT_PREAMBLE;
96 - info->antenna_sel_tx = local->hw.conf.antenna_sel_tx;
97 info->control.retry_limit = 1;
100 --- everything.orig/drivers/net/wireless/b43/main.c 2008-10-08 22:40:06.000000000 +0200
101 +++ everything/drivers/net/wireless/b43/main.c 2008-10-08 22:40:45.000000000 +0200
102 @@ -1339,25 +1339,6 @@ u8 b43_ieee80211_antenna_sanitize(struct
106 -static int b43_antenna_from_ieee80211(struct b43_wldev *dev, u8 antenna)
108 - antenna = b43_ieee80211_antenna_sanitize(dev, antenna);
110 - case 0: /* default/diversity */
111 - return B43_ANTENNA_DEFAULT;
112 - case 1: /* Antenna 0 */
113 - return B43_ANTENNA0;
114 - case 2: /* Antenna 1 */
115 - return B43_ANTENNA1;
116 - case 3: /* Antenna 2 */
117 - return B43_ANTENNA2;
118 - case 4: /* Antenna 3 */
119 - return B43_ANTENNA3;
121 - return B43_ANTENNA_DEFAULT;
125 /* Convert a b43 antenna number value to the PHY TX control value. */
126 static u16 b43_antenna_to_phyctl(int antenna)
128 @@ -1399,7 +1380,7 @@ static void b43_write_beacon_template(st
129 len, ram_offset, shm_size_offset, rate);
131 /* Write the PHY TX control parameters. */
132 - antenna = b43_antenna_from_ieee80211(dev, info->antenna_sel_tx);
133 + antenna = B43_ANTENNA_DEFAULT;
134 antenna = b43_antenna_to_phyctl(antenna);
135 ctl = b43_shm_read16(dev, B43_SHM_SHARED, B43_SHM_SH_BEACPHYCTL);
136 /* We can't send beacons with short preamble. Would get PHY errors. */
137 @@ -3399,9 +3380,9 @@ static int b43_op_config(struct ieee8021
140 /* Antennas for RX and management frame TX. */
141 - antenna = b43_antenna_from_ieee80211(dev, conf->antenna_sel_tx);
142 + antenna = B43_ANTENNA_DEFAULT;
143 b43_mgmtframe_txantenna(dev, antenna);
144 - antenna = b43_antenna_from_ieee80211(dev, conf->antenna_sel_rx);
145 + antenna = B43_ANTENNA_DEFAULT;
146 if (phy->ops->set_rx_antenna)
147 phy->ops->set_rx_antenna(dev, antenna);
149 --- everything.orig/drivers/net/wireless/b43legacy/main.c 2008-10-08 22:41:36.000000000 +0200
150 +++ everything/drivers/net/wireless/b43legacy/main.c 2008-10-08 22:41:59.000000000 +0200
151 @@ -2556,20 +2556,6 @@ init_failure:
155 -static int b43legacy_antenna_from_ieee80211(u8 antenna)
158 - case 0: /* default/diversity */
159 - return B43legacy_ANTENNA_DEFAULT;
160 - case 1: /* Antenna 0 */
161 - return B43legacy_ANTENNA0;
162 - case 2: /* Antenna 1 */
163 - return B43legacy_ANTENNA1;
165 - return B43legacy_ANTENNA_DEFAULT;
169 static int b43legacy_op_dev_config(struct ieee80211_hw *hw,
170 struct ieee80211_conf *conf)
172 @@ -2583,8 +2569,8 @@ static int b43legacy_op_dev_config(struc
176 - antenna_tx = b43legacy_antenna_from_ieee80211(conf->antenna_sel_tx);
177 - antenna_rx = b43legacy_antenna_from_ieee80211(conf->antenna_sel_rx);
178 + antenna_tx = B43legacy_ANTENNA_DEFAULT;
179 + antenna_rx = B43legacy_ANTENNA_DEFAULT;
181 mutex_lock(&wl->mutex);
182 dev = wl->current_dev;
183 --- everything.orig/drivers/net/wireless/p54/p54common.c 2008-10-08 22:43:54.000000000 +0200
184 +++ everything/drivers/net/wireless/p54/p54common.c 2008-10-08 22:44:12.000000000 +0200
185 @@ -1211,8 +1211,7 @@ static int p54_config(struct ieee80211_h
186 struct p54_common *priv = dev->priv;
188 mutex_lock(&priv->conf_mutex);
189 - priv->rx_antenna = (conf->antenna_sel_rx == 0) ?
190 - 2 : conf->antenna_sel_tx - 1;
191 + priv->rx_antenna = 2; /* automatic */
192 priv->output_power = conf->power_level << 2;
193 ret = p54_set_freq(dev, cpu_to_le16(conf->channel->center_freq));
195 --- everything.orig/drivers/net/wireless/rt2x00/rt2x00config.c 2008-10-08 22:44:57.000000000 +0200
196 +++ everything/drivers/net/wireless/rt2x00/rt2x00config.c 2008-10-08 22:45:36.000000000 +0200
197 @@ -199,23 +199,15 @@ void rt2x00lib_config(struct rt2x00_dev
198 * to work with untill the link tuner decides that an antenna
199 * switch should be performed.
201 - if (!conf->antenna_sel_rx &&
202 - default_ant->rx != ANTENNA_SW_DIVERSITY &&
203 + if (default_ant->rx != ANTENNA_SW_DIVERSITY &&
204 default_ant->rx != active_ant->rx)
205 flags |= CONFIG_UPDATE_ANTENNA;
206 - else if (conf->antenna_sel_rx &&
207 - conf->antenna_sel_rx != active_ant->rx)
208 - flags |= CONFIG_UPDATE_ANTENNA;
209 else if (active_ant->rx == ANTENNA_SW_DIVERSITY)
210 flags |= CONFIG_UPDATE_ANTENNA;
212 - if (!conf->antenna_sel_tx &&
213 - default_ant->tx != ANTENNA_SW_DIVERSITY &&
214 + if (default_ant->tx != ANTENNA_SW_DIVERSITY &&
215 default_ant->tx != active_ant->tx)
216 flags |= CONFIG_UPDATE_ANTENNA;
217 - else if (conf->antenna_sel_tx &&
218 - conf->antenna_sel_tx != active_ant->tx)
219 - flags |= CONFIG_UPDATE_ANTENNA;
220 else if (active_ant->tx == ANTENNA_SW_DIVERSITY)
221 flags |= CONFIG_UPDATE_ANTENNA;
223 @@ -252,18 +244,14 @@ config:
226 if (flags & CONFIG_UPDATE_ANTENNA) {
227 - if (conf->antenna_sel_rx)
228 - libconf.ant.rx = conf->antenna_sel_rx;
229 - else if (default_ant->rx != ANTENNA_SW_DIVERSITY)
230 + if (default_ant->rx != ANTENNA_SW_DIVERSITY)
231 libconf.ant.rx = default_ant->rx;
232 else if (active_ant->rx == ANTENNA_SW_DIVERSITY)
233 libconf.ant.rx = ANTENNA_B;
235 libconf.ant.rx = active_ant->rx;
237 - if (conf->antenna_sel_tx)
238 - libconf.ant.tx = conf->antenna_sel_tx;
239 - else if (default_ant->tx != ANTENNA_SW_DIVERSITY)
240 + if (default_ant->tx != ANTENNA_SW_DIVERSITY)
241 libconf.ant.tx = default_ant->tx;
242 else if (active_ant->tx == ANTENNA_SW_DIVERSITY)
243 libconf.ant.tx = ANTENNA_B;
244 --- everything.orig/drivers/net/wireless/rt2x00/rt2x00dev.c 2008-10-08 22:44:28.000000000 +0200
245 +++ everything/drivers/net/wireless/rt2x00/rt2x00dev.c 2008-10-08 22:44:43.000000000 +0200
246 @@ -249,11 +249,9 @@ static void rt2x00lib_evaluate_antenna(s
247 rt2x00dev->link.ant.flags &= ~ANTENNA_RX_DIVERSITY;
248 rt2x00dev->link.ant.flags &= ~ANTENNA_TX_DIVERSITY;
250 - if (rt2x00dev->hw->conf.antenna_sel_rx == 0 &&
251 - rt2x00dev->default_ant.rx == ANTENNA_SW_DIVERSITY)
252 + if (rt2x00dev->default_ant.rx == ANTENNA_SW_DIVERSITY)
253 rt2x00dev->link.ant.flags |= ANTENNA_RX_DIVERSITY;
254 - if (rt2x00dev->hw->conf.antenna_sel_tx == 0 &&
255 - rt2x00dev->default_ant.tx == ANTENNA_SW_DIVERSITY)
256 + if (rt2x00dev->default_ant.tx == ANTENNA_SW_DIVERSITY)
257 rt2x00dev->link.ant.flags |= ANTENNA_TX_DIVERSITY;
259 if (!(rt2x00dev->link.ant.flags & ANTENNA_RX_DIVERSITY) &&