switch: add dump pvid function

This commit is contained in:
hanwckf 2023-12-20 20:39:57 +08:00
parent 3cba2c92f9
commit 6e450a7355
2 changed files with 12 additions and 3 deletions

View File

@ -119,7 +119,7 @@ static void usage(char *cmd)
printf(" Full Example: %s vlan set 0 3 10000100 0 0 20000200\n", cmd);
printf(" 8.3) %s vlan vid [vlan idx] [active:0|1] [vid] [portMap] - set switch vlan vid elements \n", cmd);
printf(" [egtagPortMap] [ivl_en] [fid] [stag] \n");
printf(" 8.4) %s vlan pvid [port] [pvid] - set switch vlan pvid \n", cmd);
printf(" 8.4) %s vlan pvid (dump | [port] [pvid] ) - set switch vlan pvid \n", cmd);
printf(" 8.5) %s vlan acc-frm [port] [acceptable_frame_type:0~3] - set switch vlan acceptable_frame type : admit all frames: 0, \n", cmd);
printf(" admit only vlan-taged frames: 1,admit only untagged or priority-tagged frames: 2, reserved:3 \n");
printf(" 8.6) %s vlan port-attr [port] [attr:0~3] - set switch vlan port attribute: user port: 0, statck port: 1, \n", cmd);

View File

@ -2742,7 +2742,7 @@ static int macMT753xVlanSetPvid(unsigned char port, unsigned short pvid)
printf("SetPVID: port:%d pvid:%d\r\n", port, pvid);
return 0;
}
/*
static int macMT753xVlanGetPvid(unsigned char port)
{
unsigned int value;
@ -2753,7 +2753,8 @@ static int macMT753xVlanGetPvid(unsigned char port)
reg = 0x2014 + (port * 0x100);
reg_read(reg, &value);
return (value & 0xfff);
} */
}
/*
static int macMT753xVlanDisp(void)
{
@ -2780,6 +2781,14 @@ void doVlanSetPvid(int argc, char *argv[])
unsigned char port = 0;
unsigned short pvid = 0;
if (argc == 4 && !strncmp("dump", argv[3], 4))
{
printf("PVID e0:%02d e1:%02d e2:%02d e3:%02d e4:%02d e5:%02d e6:%02d\n",
macMT753xVlanGetPvid(0), macMT753xVlanGetPvid(1), macMT753xVlanGetPvid(2),
macMT753xVlanGetPvid(3), macMT753xVlanGetPvid(4), macMT753xVlanGetPvid(5), macMT753xVlanGetPvid(6));
return;
}
port = atoi(argv[3]);
pvid = atoi(argv[4]);
/*Check the input parameters is right or not.*/