1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Broadcom B43 wireless driver
4 * IEEE 802.11ac AC-PHY support
6 * Copyright (c) 2015 Rafał Miłecki <zajec5@gmail.com>
12 /**************************************************
14 **************************************************/
16 static int b43_phy_ac_op_allocate(struct b43_wldev
*dev
)
18 struct b43_phy_ac
*phy_ac
;
20 phy_ac
= kzalloc(sizeof(*phy_ac
), GFP_KERNEL
);
28 static void b43_phy_ac_op_free(struct b43_wldev
*dev
)
30 struct b43_phy
*phy
= &dev
->phy
;
31 struct b43_phy_ac
*phy_ac
= phy
->ac
;
37 static void b43_phy_ac_op_maskset(struct b43_wldev
*dev
, u16 reg
, u16 mask
,
40 b43_write16f(dev
, B43_MMIO_PHY_CONTROL
, reg
);
41 b43_write16(dev
, B43_MMIO_PHY_DATA
,
42 (b43_read16(dev
, B43_MMIO_PHY_DATA
) & mask
) | set
);
45 static u16
b43_phy_ac_op_radio_read(struct b43_wldev
*dev
, u16 reg
)
47 b43_write16f(dev
, B43_MMIO_RADIO24_CONTROL
, reg
);
48 return b43_read16(dev
, B43_MMIO_RADIO24_DATA
);
51 static void b43_phy_ac_op_radio_write(struct b43_wldev
*dev
, u16 reg
,
54 b43_write16f(dev
, B43_MMIO_RADIO24_CONTROL
, reg
);
55 b43_write16(dev
, B43_MMIO_RADIO24_DATA
, value
);
58 static unsigned int b43_phy_ac_op_get_default_chan(struct b43_wldev
*dev
)
60 if (b43_current_band(dev
->wl
) == NL80211_BAND_2GHZ
)
65 static enum b43_txpwr_result
66 b43_phy_ac_op_recalc_txpower(struct b43_wldev
*dev
, bool ignore_tssi
)
68 return B43_TXPWR_RES_DONE
;
71 static void b43_phy_ac_op_adjust_txpower(struct b43_wldev
*dev
)
75 /**************************************************
77 **************************************************/
79 const struct b43_phy_operations b43_phyops_ac
= {
80 .allocate
= b43_phy_ac_op_allocate
,
81 .free
= b43_phy_ac_op_free
,
82 .phy_maskset
= b43_phy_ac_op_maskset
,
83 .radio_read
= b43_phy_ac_op_radio_read
,
84 .radio_write
= b43_phy_ac_op_radio_write
,
85 .get_default_chan
= b43_phy_ac_op_get_default_chan
,
86 .recalc_txpower
= b43_phy_ac_op_recalc_txpower
,
87 .adjust_txpower
= b43_phy_ac_op_adjust_txpower
,