From 89d198f9565e5c693252280ed8154a8cb3d131b5 Mon Sep 17 00:00:00 2001 From: Michal Sojka Date: Sun, 12 Jan 2014 10:26:05 +0100 Subject: [PATCH] mmap()-based TX works now --- ugw/ugw.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ugw/ugw.c b/ugw/ugw.c index bb654cf..64d00b0 100644 --- a/ugw/ugw.c +++ b/ugw/ugw.c @@ -195,7 +195,6 @@ int out_packet_tx(struct out_ctx *ctx, struct can_frame *cf) int ret = -1; while (hdr->tp_status != TP_STATUS_AVAILABLE) { - printf("TX status: %#x\n", hdr->tp_status); struct pollfd pfd = {.fd = ctx->s, .revents = 0, .events = POLLIN|POLLRDNORM|POLLERR }; ret = CHECK(poll(&pfd, 1, -1)); @@ -210,7 +209,6 @@ int out_packet_tx(struct out_ctx *ctx, struct can_frame *cf) if (ctx->from_in == SEND){ ret = CHECK(send(ctx->s, NULL, 0, 0)); - printf("send:%d\n", ret); return 0; } return 0; @@ -234,7 +232,7 @@ void init_packet_tx(struct out_ctx *ctx) CHECK(ioctl(s, SIOCGIFINDEX, &ifr)); my_addr.sll_family = AF_PACKET; - my_addr.sll_protocol = htons(ETH_P_ALL); + my_addr.sll_protocol = htons(ETH_P_CAN); my_addr.sll_ifindex = ifr.ifr_ifindex; CHECK(bind(s, (struct sockaddr *)&my_addr, sizeof(struct sockaddr_ll))); -- 2.39.2