diff options
author | Lorenzo Bianconi <lorenzo@kernel.org> | 2019-07-13 17:09:06 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2019-09-05 17:42:30 +0200 |
commit | 35e4ebeaace1fca705a705cd2a41c787554ac9ee (patch) | |
tree | 9a1459b9535d7d20ba1fd7ceb97bf90fb7ca06bb /drivers/net/wireless/mediatek/mt76/mmio.c | |
parent | 27b8a900b22134ec14c681a322a093d41d3c0056 (diff) | |
download | linux-stable-35e4ebeaace1fca705a705cd2a41c787554ac9ee.tar.gz linux-stable-35e4ebeaace1fca705a705cd2a41c787554ac9ee.tar.bz2 linux-stable-35e4ebeaace1fca705a705cd2a41c787554ac9ee.zip |
mt76: introduce mt76_mmio_read_copy routine
Add mt76_mmio_read_copy routine and the related function pointer in
mt76_bus_ops data structure. mt76_mmio_read_copy will be used to add
BIP_CMAC_128 cipher hw support to mt7615 driver
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless/mediatek/mt76/mmio.c')
-rw-r--r-- | drivers/net/wireless/mediatek/mt76/mmio.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mmio.c b/drivers/net/wireless/mediatek/mt76/mmio.c index 83c96a47914f..33512801dc02 100644 --- a/drivers/net/wireless/mediatek/mt76/mmio.c +++ b/drivers/net/wireless/mediatek/mt76/mmio.c @@ -40,12 +40,18 @@ static u32 mt76_mmio_rmw(struct mt76_dev *dev, u32 offset, u32 mask, u32 val) return val; } -static void mt76_mmio_copy(struct mt76_dev *dev, u32 offset, const void *data, - int len) +static void mt76_mmio_write_copy(struct mt76_dev *dev, u32 offset, + const void *data, int len) { __iowrite32_copy(dev->mmio.regs + offset, data, DIV_ROUND_UP(len, 4)); } +static void mt76_mmio_read_copy(struct mt76_dev *dev, u32 offset, + void *data, int len) +{ + __ioread32_copy(data, dev->mmio.regs + offset, DIV_ROUND_UP(len, 4)); +} + static int mt76_mmio_wr_rp(struct mt76_dev *dev, u32 base, const struct mt76_reg_pair *data, int len) { @@ -89,7 +95,8 @@ void mt76_mmio_init(struct mt76_dev *dev, void __iomem *regs) .rr = mt76_mmio_rr, .rmw = mt76_mmio_rmw, .wr = mt76_mmio_wr, - .copy = mt76_mmio_copy, + .write_copy = mt76_mmio_write_copy, + .read_copy = mt76_mmio_read_copy, .wr_rp = mt76_mmio_wr_rp, .rd_rp = mt76_mmio_rd_rp, .type = MT76_BUS_MMIO, |