diff options
author | Vivien Didelot | 2016-11-04 03:23:26 +0100 |
---|---|---|
committer | David S. Miller | 2016-11-04 19:39:58 +0100 |
commit | 18abed211c0503167a566d3ff330dc7ca44e5fc6 (patch) | |
tree | 3fa7bb760b0116bf031b25c7d51f29180b34ccb6 /drivers/net/dsa/mv88e6xxx/port.c | |
parent | net/sched: cls_flower: Support matching on SCTP ports (diff) | |
download | kernel-qcow2-linux-18abed211c0503167a566d3ff330dc7ca44e5fc6.tar.gz kernel-qcow2-linux-18abed211c0503167a566d3ff330dc7ca44e5fc6.tar.xz kernel-qcow2-linux-18abed211c0503167a566d3ff330dc7ca44e5fc6.zip |
net: dsa: mv88e6xxx: add port files
The Marvell switches contains one internal SMI device per port, called
"Port Registers". Depending on the model, the addresses of these devices
start from 0x0, 0x8 or 0x10.
Start moving Port Registers specific code to their own files.
Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/dsa/mv88e6xxx/port.c')
-rw-r--r-- | drivers/net/dsa/mv88e6xxx/port.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/drivers/net/dsa/mv88e6xxx/port.c b/drivers/net/dsa/mv88e6xxx/port.c new file mode 100644 index 000000000000..3b36c9290ea8 --- /dev/null +++ b/drivers/net/dsa/mv88e6xxx/port.c @@ -0,0 +1,31 @@ +/* + * Marvell 88E6xxx Switch Port Registers support + * + * Copyright (c) 2008 Marvell Semiconductor + * + * Copyright (c) 2016 Vivien Didelot <vivien.didelot@savoirfairelinux.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + */ + +#include "mv88e6xxx.h" +#include "port.h" + +int mv88e6xxx_port_read(struct mv88e6xxx_chip *chip, int port, int reg, + u16 *val) +{ + int addr = chip->info->port_base_addr + port; + + return mv88e6xxx_read(chip, addr, reg, val); +} + +int mv88e6xxx_port_write(struct mv88e6xxx_chip *chip, int port, int reg, + u16 val) +{ + int addr = chip->info->port_base_addr + port; + + return mv88e6xxx_write(chip, addr, reg, val); +} |