Vivien Didelot | 332aa5c | 2017-05-01 14:05:12 -0400 | [diff] [blame^] | 1 | /* |
| 2 | * Marvell 88E6xxx VLAN [Spanning Tree] Translation Unit (VTU [STU]) support |
| 3 | * |
| 4 | * Copyright (c) 2008 Marvell Semiconductor |
| 5 | * Copyright (c) 2015 CMC Electronics, Inc. |
| 6 | * Copyright (c) 2017 Savoir-faire Linux, Inc. |
| 7 | * |
| 8 | * This program is free software; you can redistribute it and/or modify |
| 9 | * it under the terms of the GNU General Public License as published by |
| 10 | * the Free Software Foundation; either version 2 of the License, or |
| 11 | * (at your option) any later version. |
| 12 | */ |
| 13 | |
| 14 | #include "mv88e6xxx.h" |
| 15 | #include "global1.h" |
| 16 | |
| 17 | /* Offset 0x05: VTU Operation Register */ |
| 18 | |
| 19 | int mv88e6xxx_g1_vtu_op_wait(struct mv88e6xxx_chip *chip) |
| 20 | { |
| 21 | return mv88e6xxx_g1_wait(chip, GLOBAL_VTU_OP, GLOBAL_VTU_OP_BUSY); |
| 22 | } |
| 23 | |
| 24 | int mv88e6xxx_g1_vtu_op(struct mv88e6xxx_chip *chip, u16 op) |
| 25 | { |
| 26 | int err; |
| 27 | |
| 28 | err = mv88e6xxx_g1_write(chip, GLOBAL_VTU_OP, op); |
| 29 | if (err) |
| 30 | return err; |
| 31 | |
| 32 | return mv88e6xxx_g1_vtu_op_wait(chip); |
| 33 | } |