@@ -272,6 +272,9 @@ struct mv88e6xxx_vlan {
bool valid;
};
+/* MacAuth Bypass Control Flag */
+#define MV88E6XXX_PORT_FLAG_MAB BIT(0)
+
struct mv88e6xxx_port {
struct mv88e6xxx_chip *chip;
int port;
@@ -288,9 +291,7 @@ struct mv88e6xxx_port {
bool mirror_egress;
struct devlink_region *region;
void *pcs_private;
-
- /* MacAuth Bypass control flag */
- bool mab;
+ unsigned int flags;
};
enum mv88e6xxx_region_id {
@@ -802,7 +803,10 @@ static inline bool mv88e6xxx_is_invalid_port(struct mv88e6xxx_chip *chip, int po
static inline void mv88e6xxx_port_set_mab(struct mv88e6xxx_chip *chip,
int port, bool mab)
{
- chip->ports[port].mab = mab;
+ if (mab)
+ chip->ports[port].flags |= MV88E6XXX_PORT_FLAG_MAB;
+ else
+ chip->ports[port].flags &= ~MV88E6XXX_PORT_FLAG_MAB;
}
int mv88e6xxx_read(struct mv88e6xxx_chip *chip, int addr, int reg, u16 *val);
@@ -445,7 +445,8 @@ static irqreturn_t mv88e6xxx_g1_atu_prob_irq_thread_fn(int irq, void *dev_id)
fid);
chip->ports[spid].atu_miss_violation++;
- if (fid != MV88E6XXX_FID_STANDALONE && chip->ports[spid].mab) {
+ if (fid != MV88E6XXX_FID_STANDALONE &&
+ !!(chip->ports[spid].flags & MV88E6XXX_PORT_FLAG_MAB)) {
err = mv88e6xxx_handle_miss_violation(chip, spid,
&entry, fid);
if (err)
Convert MAB (MacAuth Bypass) flag to use bitmap. A new port flag will be added with a subsequent patch. Convert the 'mab' member to a bit in a bitmask to save space. Signed-off-by: Joseph Huang <Joseph.Huang@garmin.com> --- drivers/net/dsa/mv88e6xxx/chip.h | 12 ++++++++---- drivers/net/dsa/mv88e6xxx/global1_atu.c | 3 ++- 2 files changed, 10 insertions(+), 5 deletions(-)