Loading...
1/* SPDX-License-Identifier: GPL-2.0-or-later */
2/*
3
4 Broadcom B43legacy wireless driver
5
6 Copyright (c) 2005 Martin Langer <martin-langer@gmx.de>,
7 Stefano Brivio <stefano.brivio@polimi.it>
8 Michael Buesch <m@bues.ch>
9 Danny van Dyk <kugelfang@gentoo.org>
10 Andreas Jaggi <andreas.jaggi@waterwave.ch>
11
12 Some parts of the code in this file are derived from the ipw2200
13 driver Copyright(c) 2003 - 2004 Intel Corporation.
14
15
16*/
17
18#ifndef B43legacy_RADIO_H_
19#define B43legacy_RADIO_H_
20
21#include "b43legacy.h"
22
23
24#define B43legacy_RADIO_DEFAULT_CHANNEL_BG 6
25
26/* Force antenna 0. */
27#define B43legacy_RADIO_TXANTENNA_0 0
28/* Force antenna 1. */
29#define B43legacy_RADIO_TXANTENNA_1 1
30/* Use the RX antenna, that was selected for the most recently
31 * received good PLCP header.
32 */
33#define B43legacy_RADIO_TXANTENNA_LASTPLCP 3
34#define B43legacy_RADIO_TXANTENNA_DEFAULT B43legacy_RADIO_TXANTENNA_LASTPLCP
35
36#define B43legacy_RADIO_INTERFMODE_NONE 0
37#define B43legacy_RADIO_INTERFMODE_NONWLAN 1
38#define B43legacy_RADIO_INTERFMODE_MANUALWLAN 2
39#define B43legacy_RADIO_INTERFMODE_AUTOWLAN 3
40
41
42void b43legacy_radio_lock(struct b43legacy_wldev *dev);
43void b43legacy_radio_unlock(struct b43legacy_wldev *dev);
44
45u16 b43legacy_radio_read16(struct b43legacy_wldev *dev, u16 offset);
46void b43legacy_radio_write16(struct b43legacy_wldev *dev, u16 offset, u16 val);
47
48u16 b43legacy_radio_init2050(struct b43legacy_wldev *dev);
49
50void b43legacy_radio_turn_on(struct b43legacy_wldev *dev);
51void b43legacy_radio_turn_off(struct b43legacy_wldev *dev, bool force);
52
53int b43legacy_radio_selectchannel(struct b43legacy_wldev *dev, u8 channel,
54 int synthetic_pu_workaround);
55
56void b43legacy_radio_set_txpower_a(struct b43legacy_wldev *dev, u16 txpower);
57void b43legacy_radio_set_txpower_bg(struct b43legacy_wldev *dev,
58 u16 baseband_attenuation, u16 attenuation,
59 u16 txpower);
60
61u16 b43legacy_default_baseband_attenuation(struct b43legacy_wldev *dev);
62u16 b43legacy_default_radio_attenuation(struct b43legacy_wldev *dev);
63u16 b43legacy_default_txctl1(struct b43legacy_wldev *dev);
64
65void b43legacy_radio_set_txantenna(struct b43legacy_wldev *dev, u32 val);
66
67void b43legacy_radio_clear_tssi(struct b43legacy_wldev *dev);
68
69u8 b43legacy_radio_aci_detect(struct b43legacy_wldev *dev, u8 channel);
70u8 b43legacy_radio_aci_scan(struct b43legacy_wldev *dev);
71
72int b43legacy_radio_set_interference_mitigation(struct b43legacy_wldev *dev,
73 int mode);
74
75void b43legacy_calc_nrssi_slope(struct b43legacy_wldev *dev);
76void b43legacy_calc_nrssi_threshold(struct b43legacy_wldev *dev);
77s16 b43legacy_nrssi_hw_read(struct b43legacy_wldev *dev, u16 offset);
78void b43legacy_nrssi_hw_write(struct b43legacy_wldev *dev, u16 offset, s16 val);
79void b43legacy_nrssi_hw_update(struct b43legacy_wldev *dev, u16 val);
80void b43legacy_nrssi_mem_update(struct b43legacy_wldev *dev);
81
82u16 b43legacy_radio_calibrationvalue(struct b43legacy_wldev *dev);
83
84#endif /* B43legacy_RADIO_H_ */
1/*
2
3 Broadcom B43legacy wireless driver
4
5 Copyright (c) 2005 Martin Langer <martin-langer@gmx.de>,
6 Stefano Brivio <stefano.brivio@polimi.it>
7 Michael Buesch <m@bues.ch>
8 Danny van Dyk <kugelfang@gentoo.org>
9 Andreas Jaggi <andreas.jaggi@waterwave.ch>
10
11 Some parts of the code in this file are derived from the ipw2200
12 driver Copyright(c) 2003 - 2004 Intel Corporation.
13
14 This program is free software; you can redistribute it and/or modify
15 it under the terms of the GNU General Public License as published by
16 the Free Software Foundation; either version 2 of the License, or
17 (at your option) any later version.
18
19 This program is distributed in the hope that it will be useful,
20 but WITHOUT ANY WARRANTY; without even the implied warranty of
21 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 GNU General Public License for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with this program; see the file COPYING. If not, write to
26 the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor,
27 Boston, MA 02110-1301, USA.
28
29*/
30
31#ifndef B43legacy_RADIO_H_
32#define B43legacy_RADIO_H_
33
34#include "b43legacy.h"
35
36
37#define B43legacy_RADIO_DEFAULT_CHANNEL_BG 6
38
39/* Force antenna 0. */
40#define B43legacy_RADIO_TXANTENNA_0 0
41/* Force antenna 1. */
42#define B43legacy_RADIO_TXANTENNA_1 1
43/* Use the RX antenna, that was selected for the most recently
44 * received good PLCP header.
45 */
46#define B43legacy_RADIO_TXANTENNA_LASTPLCP 3
47#define B43legacy_RADIO_TXANTENNA_DEFAULT B43legacy_RADIO_TXANTENNA_LASTPLCP
48
49#define B43legacy_RADIO_INTERFMODE_NONE 0
50#define B43legacy_RADIO_INTERFMODE_NONWLAN 1
51#define B43legacy_RADIO_INTERFMODE_MANUALWLAN 2
52#define B43legacy_RADIO_INTERFMODE_AUTOWLAN 3
53
54
55void b43legacy_radio_lock(struct b43legacy_wldev *dev);
56void b43legacy_radio_unlock(struct b43legacy_wldev *dev);
57
58u16 b43legacy_radio_read16(struct b43legacy_wldev *dev, u16 offset);
59void b43legacy_radio_write16(struct b43legacy_wldev *dev, u16 offset, u16 val);
60
61u16 b43legacy_radio_init2050(struct b43legacy_wldev *dev);
62
63void b43legacy_radio_turn_on(struct b43legacy_wldev *dev);
64void b43legacy_radio_turn_off(struct b43legacy_wldev *dev, bool force);
65
66int b43legacy_radio_selectchannel(struct b43legacy_wldev *dev, u8 channel,
67 int synthetic_pu_workaround);
68
69void b43legacy_radio_set_txpower_a(struct b43legacy_wldev *dev, u16 txpower);
70void b43legacy_radio_set_txpower_bg(struct b43legacy_wldev *dev,
71 u16 baseband_attenuation, u16 attenuation,
72 u16 txpower);
73
74u16 b43legacy_default_baseband_attenuation(struct b43legacy_wldev *dev);
75u16 b43legacy_default_radio_attenuation(struct b43legacy_wldev *dev);
76u16 b43legacy_default_txctl1(struct b43legacy_wldev *dev);
77
78void b43legacy_radio_set_txantenna(struct b43legacy_wldev *dev, u32 val);
79
80void b43legacy_radio_clear_tssi(struct b43legacy_wldev *dev);
81
82u8 b43legacy_radio_aci_detect(struct b43legacy_wldev *dev, u8 channel);
83u8 b43legacy_radio_aci_scan(struct b43legacy_wldev *dev);
84
85int b43legacy_radio_set_interference_mitigation(struct b43legacy_wldev *dev,
86 int mode);
87
88void b43legacy_calc_nrssi_slope(struct b43legacy_wldev *dev);
89void b43legacy_calc_nrssi_threshold(struct b43legacy_wldev *dev);
90s16 b43legacy_nrssi_hw_read(struct b43legacy_wldev *dev, u16 offset);
91void b43legacy_nrssi_hw_write(struct b43legacy_wldev *dev, u16 offset, s16 val);
92void b43legacy_nrssi_hw_update(struct b43legacy_wldev *dev, u16 val);
93void b43legacy_nrssi_mem_update(struct b43legacy_wldev *dev);
94
95u16 b43legacy_radio_calibrationvalue(struct b43legacy_wldev *dev);
96
97#endif /* B43legacy_RADIO_H_ */