diff options
| author | Vivien Didelot <vivien.didelot@savoirfairelinux.com> | 2017-05-01 14:05:20 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2017-05-01 15:03:11 -0400 |
| commit | ef6fcea37f014ec54a0a9f7eaecc78cdb6ffc71e (patch) | |
| tree | b87e509a726da487ecd82c856ee4071a3bc7a8b6 | |
| parent | 66a8e1f93319b8e3f5b6e81c06a2534c1491157c (diff) | |
net: dsa: mv88e6xxx: get STU entry on VTU GetNext
Now that the code reads both VTU and STU data on VTU GetNext operation,
fetch the STU entry data of a VTU entry at the same time.
The STU data bits are masked with the VTU data bits and they are now all
read at the same time a VTU GetNext operation is issued.
Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
| -rw-r--r-- | drivers/net/dsa/mv88e6xxx/chip.c | 2 | ||||
| -rw-r--r-- | drivers/net/dsa/mv88e6xxx/global1.h | 2 | ||||
| -rw-r--r-- | drivers/net/dsa/mv88e6xxx/global1_vtu.c | 22 |
3 files changed, 25 insertions, 1 deletions
diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c index 5441b05f519b..38c3e047fbf9 100644 --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c | |||
| @@ -1292,7 +1292,7 @@ static int _mv88e6xxx_vtu_getnext(struct mv88e6xxx_chip *chip, | |||
| 1292 | } | 1292 | } |
| 1293 | 1293 | ||
| 1294 | if (mv88e6xxx_has(chip, MV88E6XXX_FLAG_STU)) { | 1294 | if (mv88e6xxx_has(chip, MV88E6XXX_FLAG_STU)) { |
| 1295 | err = mv88e6xxx_g1_vtu_sid_read(chip, &next); | 1295 | err = mv88e6xxx_g1_vtu_stu_get(chip, &next); |
| 1296 | if (err) | 1296 | if (err) |
| 1297 | return err; | 1297 | return err; |
| 1298 | } | 1298 | } |
diff --git a/drivers/net/dsa/mv88e6xxx/global1.h b/drivers/net/dsa/mv88e6xxx/global1.h index 5d276cc4262b..76b49a3a4701 100644 --- a/drivers/net/dsa/mv88e6xxx/global1.h +++ b/drivers/net/dsa/mv88e6xxx/global1.h | |||
| @@ -72,6 +72,8 @@ int mv88e6xxx_g1_vtu_getnext(struct mv88e6xxx_chip *chip, | |||
| 72 | struct mv88e6xxx_vtu_entry *entry); | 72 | struct mv88e6xxx_vtu_entry *entry); |
| 73 | int mv88e6xxx_g1_vtu_stu_getnext(struct mv88e6xxx_chip *chip, | 73 | int mv88e6xxx_g1_vtu_stu_getnext(struct mv88e6xxx_chip *chip, |
| 74 | struct mv88e6xxx_vtu_entry *vtu); | 74 | struct mv88e6xxx_vtu_entry *vtu); |
| 75 | int mv88e6xxx_g1_vtu_stu_get(struct mv88e6xxx_chip *chip, | ||
| 76 | struct mv88e6xxx_vtu_entry *vtu); | ||
| 75 | int mv88e6xxx_g1_vtu_flush(struct mv88e6xxx_chip *chip); | 77 | int mv88e6xxx_g1_vtu_flush(struct mv88e6xxx_chip *chip); |
| 76 | 78 | ||
| 77 | #endif /* _MV88E6XXX_GLOBAL1_H */ | 79 | #endif /* _MV88E6XXX_GLOBAL1_H */ |
diff --git a/drivers/net/dsa/mv88e6xxx/global1_vtu.c b/drivers/net/dsa/mv88e6xxx/global1_vtu.c index cf572ba76195..710f86fa3b4e 100644 --- a/drivers/net/dsa/mv88e6xxx/global1_vtu.c +++ b/drivers/net/dsa/mv88e6xxx/global1_vtu.c | |||
| @@ -194,6 +194,28 @@ int mv88e6xxx_g1_vtu_stu_getnext(struct mv88e6xxx_chip *chip, | |||
| 194 | return mv88e6xxx_g1_vtu_vid_read(chip, entry); | 194 | return mv88e6xxx_g1_vtu_vid_read(chip, entry); |
| 195 | } | 195 | } |
| 196 | 196 | ||
| 197 | int mv88e6xxx_g1_vtu_stu_get(struct mv88e6xxx_chip *chip, | ||
| 198 | struct mv88e6xxx_vtu_entry *vtu) | ||
| 199 | { | ||
| 200 | struct mv88e6xxx_vtu_entry stu; | ||
| 201 | int err; | ||
| 202 | |||
| 203 | err = mv88e6xxx_g1_vtu_sid_read(chip, vtu); | ||
| 204 | if (err) | ||
| 205 | return err; | ||
| 206 | |||
| 207 | stu.sid = vtu->sid - 1; | ||
| 208 | |||
| 209 | err = mv88e6xxx_g1_vtu_stu_getnext(chip, &stu); | ||
| 210 | if (err) | ||
| 211 | return err; | ||
| 212 | |||
| 213 | if (stu.sid != vtu->sid || !stu.valid) | ||
| 214 | return -EINVAL; | ||
| 215 | |||
| 216 | return 0; | ||
| 217 | } | ||
| 218 | |||
| 197 | int mv88e6xxx_g1_vtu_getnext(struct mv88e6xxx_chip *chip, | 219 | int mv88e6xxx_g1_vtu_getnext(struct mv88e6xxx_chip *chip, |
| 198 | struct mv88e6xxx_vtu_entry *entry) | 220 | struct mv88e6xxx_vtu_entry *entry) |
| 199 | { | 221 | { |
