From: Michal Sojka Date: Sun, 12 Jan 2014 09:26:05 +0000 (+0100) Subject: mmap()-based TX works now X-Git-Tag: fix-allnoconfig~94 X-Git-Url: http://rtime.felk.cvut.cz/gitweb/can-benchmark.git/commitdiff_plain/89d198f9565e5c693252280ed8154a8cb3d131b5 mmap()-based TX works now --- 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)));