This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM3356: LLDP protocol settings on am335x-evmsk

Part Number: AM3356

Hi,

I need to set up LLDP protocol on am335x-evmsk and the CPSW is set to switch mode.

Could you tell me how to do it? 

1. add a LLDP Multicast address and forward the multicast packet to the subscribed ports ?

Here is an example from last post, does it work?

struct net_switch_config cmd_struct;
struct ifreq ifr;
int sockfd;
strncpy(ifr.ifr_name, "eth0", IFNAMSIZ);
ifr.ifr_data = (char*)&cmd_struct;
if ((sockfd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
    printf("Can't open the socket\n");
    return -1;
}
memset(&cmd_struct, 0, sizeof(struct net_switch_config));

cmd_struct.cmd = CONFIG_SWITCH_ADD_MULTICAST;
cmd_struct.addr[0] = 0x01;
cmd_struct.addr[1] = 0x80;
cmd_struct.addr[2] = 0xc2;
cmd_struct.addr[3] = 0x00;
cmd_struct.addr[4] = 0x00;
cmd_struct.addr[5] = 0x0e;
cmd_struct.port = 0x03;
cmd_struct.vid = 0x01;
cmd_struct.super = 0x00;


if (ioctl(sockfd, SIOCSWITCHCONFIG, &ifr) < 0) {
        printf("Command failed\n");
        close(sockfd);
        return -1;
    }


cmd_struct.cmd = CONFIG_SWITCH_ADD_MULTICAST;
cmd_struct.addr[0] = 0x01;
cmd_struct.addr[1] = 0x80;
cmd_struct.addr[2] = 0xc2;
cmd_struct.addr[3] = 0x00;
cmd_struct.addr[4] = 0x00;
cmd_struct.addr[5] = 0x0e;
cmd_struct.port = 0x05;
cmd_struct.vid = 0x02;
cmd_struct.super = 0x00;


if (ioctl(sockfd, SIOCSWITCHCONFIG, &ifr) < 0) {
        printf("Command failed\n");
        close(sockfd);
        return -1;
    }    
    
printf("command success\n");
close(sockfd);

2. dual-port switch device needs to be assigned mac address on each external port to apply LLDP, but how to do it?

SDK: ti-processor-sdk-linux-rt-am335x-evm-08.02.00.24

Hardware : TI AM335x EVM-SK

Thanks.