Commit 1066ae7b authored by Alessandro Rubini's avatar Alessandro Rubini

wr_sockaddr_t: remove field family (it had no effect)

The function ptpd_netif_create_socket() 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>

y
parent 223c36c5
......@@ -64,7 +64,7 @@ include softpll/softpll.mk
# ppsi already has div64 (the same one), so only pick it if not using ppsi.
ifndef CONFIG_PPSI
obj-y += pp_printf/div64.o
# unfortunately, we need a prototype there
# unfortunately, we need a prototype therex
cflags-y += -include include/wrc.h
endif
# And always complain if we pick the libgcc division: 64/32 = 32 is enough here.
......
......@@ -7,8 +7,7 @@
#include <board.h>
//#include <inttypes.h>
#define PTPD_SOCK_RAW_ETHERNET 1
#define PTPD_SOCK_UDP 2
#define PTPD_SOCK_RAW_ETHERNET 1 /* used in ppsi to no aim: remove this */
#define PTPD_FLAGS_MULTICAST 0x1
......@@ -47,8 +46,6 @@ typedef void *wr_socket_t;
// Socket address for ptp_netif_ functions
typedef struct {
// Socket family (RAW ethernet/UDP)
int family;
// MAC address
mac_addr_t mac;
// Destination MASC address, filled by recvfrom() function on interfaces bound to multiple addresses
......@@ -90,7 +87,7 @@ int ptpd_netif_init(void);
// Creates UDP or Ethernet RAW socket (determined by sock_type) bound to bind_addr. If PTPD_FLAG_MULTICAST is set, the socket is
// automatically added to multicast group. User can specify physical_port field to bind the socket to specific switch port only.
wr_socket_t *ptpd_netif_create_socket(int sock_type, int flags,
wr_socket_t *ptpd_netif_create_socket(int unused, int unused2,
wr_sockaddr_t * bind_addr);
// Sends a UDP/RAW packet (data, data_length) to address provided in wr_sockaddr_t.
......
......@@ -37,10 +37,8 @@ void arp_init(void)
memset(&saddr, 0, sizeof(saddr));
memset(&saddr.mac, 0xFF, 6); /* Broadcast */
saddr.ethertype = htons(0x0806); /* ARP */
saddr.family = PTPD_SOCK_RAW_ETHERNET;
arp_socket = ptpd_netif_create_socket(PTPD_SOCK_RAW_ETHERNET,
0, &saddr);
arp_socket = ptpd_netif_create_socket(0, 0 /* both unused */, &saddr);
}
static int process_arp(uint8_t * buf, int len)
......
......@@ -48,10 +48,8 @@ void ipv4_init(void)
memset(&saddr, 0, sizeof(saddr));
get_mac_addr(&saddr.mac[0]); /* Unicast */
saddr.ethertype = htons(0x0800); /* IPv4 */
saddr.family = PTPD_SOCK_RAW_ETHERNET;
ipv4_socket = ptpd_netif_create_socket(PTPD_SOCK_RAW_ETHERNET,
0, &saddr);
ipv4_socket = ptpd_netif_create_socket(0, 0 /* both unused */, &saddr);
}
static int bootp_retry = 0;
......
......@@ -68,7 +68,7 @@ void ptpd_netif_set_phase_transition(uint32_t phase)
}
wr_socket_t *ptpd_netif_create_socket(int sock_type, int flags,
wr_socket_t *ptpd_netif_create_socket(int unused, int unusd2,
wr_sockaddr_t * bind_addr)
{
int i;
......@@ -87,9 +87,6 @@ wr_socket_t *ptpd_netif_create_socket(int sock_type, int flags,
return NULL;
}
if (sock_type != PTPD_SOCK_RAW_ETHERNET)
return NULL;
if (wrpc_get_port_state(&pstate, "wr0" /* unused */) < 0)
return NULL;
......
ppsi @ da4979d6
Subproject commit 1c33f8a1a5f1870c25d4b3948338be1995c9186d
Subproject commit da4979d655d2d49a443120c7f15262c5dcda40fa
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