Commit 223c36c5 authored by Alessandro Rubini's avatar Alessandro Rubini

wr_sockaddr_t: remove field if_name (it had no effect)

The function wrpc_get_port_state() still receives two arguments, because
it is being called by ppsi, and I'd better not change the API in small
steps in there.
Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent 3a58720e
......@@ -47,8 +47,6 @@ typedef void *wr_socket_t;
// Socket address for ptp_netif_ functions
typedef struct {
// Network interface name (eth0, ...)
char if_name[IFACE_NAME_LEN];
// Socket family (RAW ethernet/UDP)
int family;
// MAC address
......@@ -123,6 +121,6 @@ void ptpd_netif_linearize_rx_timestamp(wr_timestamp_t * ts, int32_t dmtd_phase,
void ptpd_netif_set_phase_transition(uint32_t phase);
struct hal_port_state;
int wrpc_get_port_state(struct hal_port_state *port, const char *port_name);
int wrpc_get_port_state(struct hal_port_state *port, const char *port_name /* unused */);
#endif /* __PTPD_NETIF_H */
......@@ -29,13 +29,12 @@ static wr_socket_t *arp_socket;
#define ARP_TPA (ARP_THA+6)
#define ARP_END (ARP_TPA+4)
void arp_init(const char *if_name)
void arp_init(void)
{
wr_sockaddr_t saddr;
/* Configure socket filter */
memset(&saddr, 0, sizeof(saddr));
strcpy(saddr.if_name, if_name);
memset(&saddr.mac, 0xFF, 6); /* Broadcast */
saddr.ethertype = htons(0x0806); /* ARP */
saddr.family = PTPD_SOCK_RAW_ETHERNET;
......
......@@ -37,16 +37,15 @@ unsigned int ipv4_checksum(unsigned short *buf, int shorts)
return (~sum & 0xffff);
}
void ipv4_init(const char *if_name)
void ipv4_init(void)
{
wr_sockaddr_t saddr;
/* Reset => need a fresh IP */
needIP = 1;
/* Configure socket filter */
memset(&saddr, 0, sizeof(saddr));
strcpy(saddr.if_name, if_name);
get_mac_addr(&saddr.mac[0]); /* Unicast */
saddr.ethertype = htons(0x0800); /* IPv4 */
saddr.family = PTPD_SOCK_RAW_ETHERNET;
......
......@@ -3,13 +3,13 @@
#include <inttypes.h>
void ipv4_init(const char *if_name);
void ipv4_init(void);
void ipv4_poll(void);
/* Internal to IP stack: */
unsigned int ipv4_checksum(unsigned short *buf, int shorts);
void arp_init(const char *if_name);
void arp_init(void);
void arp_poll(void);
extern int needIP;
......
......@@ -90,7 +90,7 @@ wr_socket_t *ptpd_netif_create_socket(int sock_type, int flags,
if (sock_type != PTPD_SOCK_RAW_ETHERNET)
return NULL;
if (wrpc_get_port_state(&pstate, bind_addr->if_name) < 0)
if (wrpc_get_port_state(&pstate, "wr0" /* unused */) < 0)
return NULL;
memcpy(&sock->bind_addr, bind_addr, sizeof(wr_sockaddr_t));
......
......@@ -95,8 +95,8 @@ static void wrc_initialize(void)
spll_very_init();
#ifdef CONFIG_ETHERBONE
ipv4_init("wru1");
arp_init("wru1");
ipv4_init();
arp_init();
#endif
}
......
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