Contributors: 2
Author |
Tokens |
Token Proportion |
Commits |
Commit Proportion |
Vladimir Oltean |
151 |
99.34% |
1 |
50.00% |
Thomas Gleixner |
1 |
0.66% |
1 |
50.00% |
Total |
152 |
|
2 |
|
// SPDX-License-Identifier: GPL-2.0-or-later
/* Copyright 2022-2023 NXP
*/
#define CREATE_TRACE_POINTS
#include "trace.h"
void dsa_db_print(const struct dsa_db *db, char buf[DSA_DB_BUFSIZ])
{
switch (db->type) {
case DSA_DB_PORT:
sprintf(buf, "port %s", db->dp->name);
break;
case DSA_DB_LAG:
sprintf(buf, "lag %s id %d", db->lag.dev->name, db->lag.id);
break;
case DSA_DB_BRIDGE:
sprintf(buf, "bridge %s num %d", db->bridge.dev->name,
db->bridge.num);
break;
default:
sprintf(buf, "unknown");
break;
}
}
const char *dsa_port_kind(const struct dsa_port *dp)
{
switch (dp->type) {
case DSA_PORT_TYPE_USER:
return "user";
case DSA_PORT_TYPE_CPU:
return "cpu";
case DSA_PORT_TYPE_DSA:
return "dsa";
default:
return "unused";
}
}