/* * netsniff-ng - the packet sniffing beast * Copyright 2009, 2010 Daniel Borkmann. * Subject to the GPL, version 2. */ #include #include #include #include #include #include #include #include #include #include "xmalloc.h" #include "die.h" #include "ring.h" #include "built_in.h" void mmap_ring_generic(int sock, struct ring *ring) { ring->mm_space = mmap(NULL, ring->mm_len, PROT_READ | PROT_WRITE, MAP_SHARED | MAP_LOCKED | MAP_POPULATE, sock, 0); if (ring->mm_space == MAP_FAILED) panic("Cannot mmap {TX,RX}_RING!\n"); } void alloc_ring_frames_generic(struct ring *ring, int num, size_t size) { int i; size_t len = num * sizeof(*ring->frames); ring->frames = xmalloc_aligned(len, CO_CACHE_LINE_SIZE); fmemset(ring->frames, 0, len); for (i = 0; i < num; ++i) { ring->frames[i].iov_len = size; ring->frames[i].iov_base = ring->mm_space + (i * size); } } void bind_ring_generic(int sock, struct ring *ring, int ifindex, bool tx_only) { int ret; /* The {TX,RX}_RING registers itself to the networking stack with * dev_add_pack(), so we have one single RX_RING for all devs * otherwise you'll get the packet twice. */ fmemset(&ring->s_ll, 0, sizeof(ring->s_ll)); ring->s_ll.sll_family = AF_PACKET; if (tx_only) ring->s_ll.sll_protocol = 0; else ring->s_ll.sll_protocol = htons(ETH_P_ALL); ring->s_ll.sll_ifindex = ifindex; ring->s_ll.sll_hatype = 0; ring->s_ll.sll_halen = 0; ring->s_ll.sll_pkttype = 0; ret = bind(sock, (struct sockaddr *) &ring->s_ll, sizeof(ring->s_ll)); if (ret < 0) panic("Cannot bind {TX,RX}_RING!\n"); } -next.git/log/drivers/hid'>logtreecommitdiff
diff options
context:
space:
mode:
authorSimon Wood <simon@mungewell.org>2015-07-23 19:10:03 -0600
committerJiri Kosina <jkosina@suse.com>2015-07-29 14:09:14 +0200
commitc873d9aba7c9782b4dc74488ab964ed6cf54678f (patch)
tree41bec1a2c7c6699e6ce397d2baa188a907872ae4 /drivers/hid
parent874bf9ee69cdebc1e734a391d6b2fa3e08c9ff87 (diff)
HID: hid-lg: Add USBID for Logitech G29 Wheel
Since this wheel is now available, and the USBID is listed on their website, this patch adds it to allow the hid-lg4ff force feedback driver to find it. I do not have this wheel to test with, but this should at least get it working in emulation mode. Note: There is probably more work required for adjust HID descriptor and handle switching between emulation and native modes. Signed-off-by: Simon Wood <simon@mungewell.org> Signed-off-by: Jiri Kosina <jkosina@suse.com>
Diffstat (limited to 'drivers/hid')