Commit f7fb9cf9 authored by José Luis  Gutiérrez's avatar José Luis Gutiérrez

hsr: unix-socket now creates HSR sockets

unix-socket unix_open_ch function creates now HSR sockets.
FIXME: creating PTP or HSR sockets should be done in compiling time...
parent a0e6ccfc
......@@ -53,7 +53,7 @@ void unix_main_loop(struct pp_globals *ppg)
* the ptp payload is one-eth-header bytes into the frame
*/
if (ppi->ethernet_mode)
NP(ppi)->ptp_offset = ETH_HLEN;
NP(ppi)->ptp_offset = ETH_HLEN + ETH_HSR_HLEN;
/*
* The main loop here is based on select. While we are not
......
......@@ -24,7 +24,7 @@ struct pp_state_table_item pp_state_table[] = {
#ifdef CONFIG_E2E
{ PPS_SLAVE, "slave", pp_slave,},
#elif CONFIG_P2P
{ PPS_SLAVE, "pclock", pp_pclock,},
{ PPS_SLAVE, "slave", pp_pclock,},
#endif
{ WRS_PRESENT, "uncalibrated/wr-present", wr_present,},
{ WRS_M_LOCK, "master/wr-m-lock", wr_m_lock,},
......
......@@ -25,7 +25,7 @@ struct pp_state_table_item pp_state_table[] __attribute__((weak)) = {
#ifdef CONFIG_E2E
{ PPS_SLAVE, "slave", pp_slave,},
#elif CONFIG_P2P
{ PPS_SLAVE, "pclock", pp_pclock,},
{ PPS_SLAVE, "slave", pp_pclock,},
#endif
{ PPS_END_OF_TABLE,}
};
......@@ -203,7 +203,8 @@ static int unix_open_ch(struct pp_instance *ppi, char *ifname, int chtype)
if (ppi->ethernet_mode) {
/* open socket */
context = "socket()";
sock = socket(PF_PACKET, SOCK_RAW, ETH_P_1588);
//sock = socket(PF_PACKET, SOCK_RAW, ETH_P_1588); /* FIXME: */
sock = socket(PF_PACKET, SOCK_RAW, ETH_P_62439_3);
if (sock < 0)
goto err_out;
......@@ -224,7 +225,8 @@ static int unix_open_ch(struct pp_instance *ppi, char *ifname, int chtype)
/* bind */
memset(&addr_ll, 0, sizeof(addr));
addr_ll.sll_family = AF_PACKET;
addr_ll.sll_protocol = htons(ETH_P_1588);
//addr_ll.sll_protocol = htons(ETH_P_1588); /* FIXME: */
addr_ll.sll_protocol = htons(ETH_P_62439_3);
addr_ll.sll_ifindex = iindex;
context = "bind()";
if (bind(sock, (struct sockaddr *)&addr_ll,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment