/* * netsniff-ng - the packet sniffing beast * Copyright 2009, 2010 Daniel Borkmann. * Subject to the GPL, version 2. */ #include #include #include /* for ntohs() */ #include "proto.h" #include "protos.h" #include "dissector_eth.h" #include "pkt_buff.h" struct udphdr { uint16_t source; uint16_t dest; uint16_t len; uint16_t check; } __packed; static void udp(struct pkt_buff *pkt) { struct udphdr *udp = (struct udphdr *) pkt_pull(pkt, sizeof(*udp)); ssize_t len; uint16_t src, dest; char *src_name, *dest_name; if (udp == NULL) return; len = ntohs(udp->len) - sizeof(*udp); src = ntohs(udp->source); dest = ntohs(udp->dest); src_name = lookup_port_udp(src); dest_name = lookup_port_udp(dest); tprintf(" [ UDP "); tprintf("Port (%u", src); if (src_name) tprintf(" (%s%s%s)", colorize_start(bold), src_name, colorize_end()); tprintf(" => %u", dest); if (dest_name) tprintf(" (%s%s%s)", colorize_start(bold), dest_name, colorize_end()); tprintf("), "); if(len > pkt_len(pkt) || len < 0){ tprintf("Len (%u) %s, ", ntohs(udp->len), colorize_start_full(black, red) "invalid" colorize_end()); } tprintf("Len (%u Bytes, %zd Bytes Data), ", ntohs(udp->len), len); tprintf("CSum (0x%.4x)", ntohs(udp->check)); tprintf(" ]\n"); } static void udp_less(struct pkt_buff *pkt) { struct udphdr *udp = (struct udphdr *) pkt_pull(pkt, sizeof(*udp)); uint16_t src, dest; char *src_name, *dest_name; if (udp == NULL) return; src = ntohs(udp->source); dest = ntohs(udp->dest); src_name = lookup_port_udp(src); dest_name = lookup_port_udp(dest); tprintf(" UDP %u", src); if(src_name) tprintf("(%s%s%s)", colorize_start(bold), src_name, colorize_end()); tprintf("/%u", dest); if (dest_name) tprintf("(%s%s%s)", colorize_start(bold), dest_name, colorize_end()); } struct protocol udp_ops = { .key = 0x11, .print_full = udp, .print_less = udp_less, }; href='/cgit.cgi/linux/net-next.git/commit/?h=nds-private-remove&id=1f1e60c9cdd573be271130e44a23efed48e0578d'>commitdiff
diff options
context:
space:
mode:
authorZidan Wang <zidan.wang@freescale.com>2015-11-24 10:18:27 +0800
committerMark Brown <broonie@kernel.org>2016-02-04 12:11:42 +0000
commit1f1e60c9cdd573be271130e44a23efed48e0578d (patch)
tree4d443c86853621913fe4f3f9e13e81a192da2327
parent92e963f50fc74041b5e9e744c330dca48e04f08d (diff)
ASoC: cs42xx8: fix the noise in the right dac channel with mono playback
When playback mono wav with record in background, there will be some nosie in the right dac channel. It seems that the ADC data has been routed to the dac channel. The cs42888 have 8 dac channels, it's appropriate to mute the unused dac channels, and the noise will disappear. Steps to reproduce this issue: arecord -D hw:0,0 -f S16_LE -r 48000 -c 1 a.wav & aplay -Dhw:0,0 audio48k16M.wav Signed-off-by: Zidan Wang <zidan.wang@freescale.com> Signed-off-by: Mark Brown <broonie@kernel.org>