mirror of
https://github.com/torvalds/linux.git
synced 2026-05-30 01:53:29 +02:00
This was done entirely with mindless brute force, using
git grep -l '\<k[vmz]*alloc_objs*(.*, GFP_KERNEL)' |
xargs sed -i 's/\(alloc_objs*(.*\), GFP_KERNEL)/\1)/'
to convert the new alloc_obj() users that had a simple GFP_KERNEL
argument to just drop that argument.
Note that due to the extreme simplicity of the scripting, any slightly
more complex cases spread over multiple lines would not be triggered:
they definitely exist, but this covers the vast bulk of the cases, and
the resulting diff is also then easier to check automatically.
For the same reason the 'flex' versions will be done as a separate
conversion.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
89 lines
2.1 KiB
C
89 lines
2.1 KiB
C
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
/*
|
|
* Broadcom B43 wireless driver
|
|
* IEEE 802.11ac AC-PHY support
|
|
*
|
|
* Copyright (c) 2015 Rafał Miłecki <zajec5@gmail.com>
|
|
*/
|
|
|
|
#include "b43.h"
|
|
#include "phy_ac.h"
|
|
|
|
/**************************************************
|
|
* Basic PHY ops
|
|
**************************************************/
|
|
|
|
static int b43_phy_ac_op_allocate(struct b43_wldev *dev)
|
|
{
|
|
struct b43_phy_ac *phy_ac;
|
|
|
|
phy_ac = kzalloc_obj(*phy_ac);
|
|
if (!phy_ac)
|
|
return -ENOMEM;
|
|
dev->phy.ac = phy_ac;
|
|
|
|
return 0;
|
|
}
|
|
|
|
static void b43_phy_ac_op_free(struct b43_wldev *dev)
|
|
{
|
|
struct b43_phy *phy = &dev->phy;
|
|
struct b43_phy_ac *phy_ac = phy->ac;
|
|
|
|
kfree(phy_ac);
|
|
phy->ac = NULL;
|
|
}
|
|
|
|
static void b43_phy_ac_op_maskset(struct b43_wldev *dev, u16 reg, u16 mask,
|
|
u16 set)
|
|
{
|
|
b43_write16f(dev, B43_MMIO_PHY_CONTROL, reg);
|
|
b43_write16(dev, B43_MMIO_PHY_DATA,
|
|
(b43_read16(dev, B43_MMIO_PHY_DATA) & mask) | set);
|
|
}
|
|
|
|
static u16 b43_phy_ac_op_radio_read(struct b43_wldev *dev, u16 reg)
|
|
{
|
|
b43_write16f(dev, B43_MMIO_RADIO24_CONTROL, reg);
|
|
return b43_read16(dev, B43_MMIO_RADIO24_DATA);
|
|
}
|
|
|
|
static void b43_phy_ac_op_radio_write(struct b43_wldev *dev, u16 reg,
|
|
u16 value)
|
|
{
|
|
b43_write16f(dev, B43_MMIO_RADIO24_CONTROL, reg);
|
|
b43_write16(dev, B43_MMIO_RADIO24_DATA, value);
|
|
}
|
|
|
|
static unsigned int b43_phy_ac_op_get_default_chan(struct b43_wldev *dev)
|
|
{
|
|
if (b43_current_band(dev->wl) == NL80211_BAND_2GHZ)
|
|
return 11;
|
|
return 36;
|
|
}
|
|
|
|
static enum b43_txpwr_result
|
|
b43_phy_ac_op_recalc_txpower(struct b43_wldev *dev, bool ignore_tssi)
|
|
{
|
|
return B43_TXPWR_RES_DONE;
|
|
}
|
|
|
|
static void b43_phy_ac_op_adjust_txpower(struct b43_wldev *dev)
|
|
{
|
|
}
|
|
|
|
/**************************************************
|
|
* PHY ops struct
|
|
**************************************************/
|
|
|
|
const struct b43_phy_operations b43_phyops_ac = {
|
|
.allocate = b43_phy_ac_op_allocate,
|
|
.free = b43_phy_ac_op_free,
|
|
.phy_maskset = b43_phy_ac_op_maskset,
|
|
.radio_read = b43_phy_ac_op_radio_read,
|
|
.radio_write = b43_phy_ac_op_radio_write,
|
|
.get_default_chan = b43_phy_ac_op_get_default_chan,
|
|
.recalc_txpower = b43_phy_ac_op_recalc_txpower,
|
|
.adjust_txpower = b43_phy_ac_op_adjust_txpower,
|
|
};
|