2 * Broadcom B43 wireless driver
3 * IEEE 802.11ac AC-PHY support
5 * Copyright (c) 2015 Rafał Miłecki <zajec5@gmail.com>
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
16 /**************************************************
18 **************************************************/
20 static int b43_phy_ac_op_allocate(struct b43_wldev
*dev
)
22 struct b43_phy_ac
*phy_ac
;
24 phy_ac
= kzalloc(sizeof(*phy_ac
), GFP_KERNEL
);
32 static void b43_phy_ac_op_free(struct b43_wldev
*dev
)
34 struct b43_phy
*phy
= &dev
->phy
;
35 struct b43_phy_ac
*phy_ac
= phy
->ac
;
41 static void b43_phy_ac_op_maskset(struct b43_wldev
*dev
, u16 reg
, u16 mask
,
44 b43_write16f(dev
, B43_MMIO_PHY_CONTROL
, reg
);
45 b43_write16(dev
, B43_MMIO_PHY_DATA
,
46 (b43_read16(dev
, B43_MMIO_PHY_DATA
) & mask
) | set
);
49 static u16
b43_phy_ac_op_radio_read(struct b43_wldev
*dev
, u16 reg
)
51 b43_write16f(dev
, B43_MMIO_RADIO24_CONTROL
, reg
);
52 return b43_read16(dev
, B43_MMIO_RADIO24_DATA
);
55 static void b43_phy_ac_op_radio_write(struct b43_wldev
*dev
, u16 reg
,
58 b43_write16f(dev
, B43_MMIO_RADIO24_CONTROL
, reg
);
59 b43_write16(dev
, B43_MMIO_RADIO24_DATA
, value
);
62 static unsigned int b43_phy_ac_op_get_default_chan(struct b43_wldev
*dev
)
64 if (b43_current_band(dev
->wl
) == NL80211_BAND_2GHZ
)
69 static enum b43_txpwr_result
70 b43_phy_ac_op_recalc_txpower(struct b43_wldev
*dev
, bool ignore_tssi
)
72 return B43_TXPWR_RES_DONE
;
75 static void b43_phy_ac_op_adjust_txpower(struct b43_wldev
*dev
)
79 /**************************************************
81 **************************************************/
83 const struct b43_phy_operations b43_phyops_ac
= {
84 .allocate
= b43_phy_ac_op_allocate
,
85 .free
= b43_phy_ac_op_free
,
86 .phy_maskset
= b43_phy_ac_op_maskset
,
87 .radio_read
= b43_phy_ac_op_radio_read
,
88 .radio_write
= b43_phy_ac_op_radio_write
,
89 .get_default_chan
= b43_phy_ac_op_get_default_chan
,
90 .recalc_txpower
= b43_phy_ac_op_recalc_txpower
,
91 .adjust_txpower
= b43_phy_ac_op_adjust_txpower
,