/* * Copyright (C) 2005-2007 Takahiro Hirofuchi */ #ifndef __USBIP_COMMON_H #define __USBIP_COMMON_H #include #include #include #include #include #include #include #include #include #ifndef USBIDS_FILE #define USBIDS_FILE "/usr/share/hwdata/usb.ids" #endif #ifndef VHCI_STATE_PATH #define VHCI_STATE_PATH "/var/run/vhci_hcd" #endif #define VUDC_DEVICE_DESCR_FILE "dev_desc" /* kernel module names */ #define USBIP_CORE_MOD_NAME "usbip-core" #define USBIP_HOST_DRV_NAME "usbip-host" #define USBIP_DEVICE_DRV_NAME "usbip-vudc" #define USBIP_VHCI_DRV_NAME "vhci_hcd" /* sysfs constants */ #define SYSFS_MNT_PATH "/sys" #define SYSFS_BUS_NAME "bus" #define SYSFS_BUS_TYPE "usb" #define SYSFS_DRIVERS_NAME "drivers" #define SYSFS_PATH_MAX 256 #define SYSFS_BUS_ID_SIZE 32 extern int usbip_use_syslog; extern int usbip_use_stderr; extern int usbip_use_debug ; #define PROGNAME "usbip" #define pr_fmt(fmt) "%s: %s: " fmt "\n", PROGNAME #define dbg_fmt(fmt) pr_fmt("%s:%d:[%s] " fmt), "debug", \ __FILE__, __LINE__, __func__ #define err(fmt, args...) \ do { \ if (usbip_use_syslog) { \ syslog(LOG_ERR, pr_fmt(fmt), "error", ##args); \ } \ if (usbip_use_stderr) { \ fprintf(stderr, pr_fmt(fmt), "error", ##args); \ } \ } while (0) #define info(fmt, args...) \ do { \ if (usbip_use_syslog) { \ syslog(LOG_INFO, pr_fmt(fmt), "info", ##args); \ } \ if (usbip_use_stderr) { \ fprintf(stderr, pr_fmt(fmt), "info", ##args); \ } \ } while (0) #define dbg(fmt, args...) \ do { \ if (usbip_use_debug) { \ if (usbip_use_syslog) { \ syslog(LOG_DEBUG, dbg_fmt(fmt), ##args); \ } \ if (usbip_use_stderr) { \ fprintf(stderr, dbg_fmt(fmt), ##args); \ } \ } \ } while (0) #define BUG() \ do { \ err("sorry, it's a bug!"); \ abort(); \ } while (0) struct usbip_usb_interface { uint8_t bInterfaceClass; uint8_t bInterfaceSubClass; uint8_t bInterfaceProtocol; uint8_t padding; /* alignment */ } __attribute__((packed)); struct usbip_usb_device { char path[SYSFS_PATH_MAX]; char busid[SYSFS_BUS_ID_SIZE]; uint32_t busnum; uint32_t devnum; uint32_t speed; uint16_t idVendor; uint16_t idProduct; uint16_t bcdDevice; uint8_t bDeviceClass; uint8_t bDeviceSubClass; uint8_t bDeviceProtocol; uint8_t bConfigurationValue; uint8_t bNumConfigurations; uint8_t bNumInterfaces; } __attribute__((packed)); #define to_string(s) #s void dump_usb_interface(struct usbip_usb_interface *); void dump_usb_device(struct usbip_usb_device *); int read_usb_device(struct udev_device *sdev, struct usbip_usb_device *udev); int read_attr_value(struct udev_device *dev, const char *name, const char *format); int read_usb_interface(struct usbip_usb_device *udev, int i, struct usbip_usb_interface *uinf); const char *usbip_speed_string(int num); const char *usbip_status_string(int32_t status); int usbip_names_init(char *); void usbip_names_free(void); void usbip_names_get_product(char *buff, size_t size, uint16_t vendor, uint16_t product); void usbip_names_get_class(char *buff, size_t size, uint8_t class, uint8_t subclass, uint8_t protocol); #endif /* __USBIP_COMMON_H */ >/imx-pcm-fiq.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2017-01-23 16:10:38 -0500
committerDavid S. Miller <davem@davemloft.net>2017-01-23 16:10:38 -0500
commit2acc76cbb7b7ad4f1e35d6c1d973f8cba1dde0bc (patch)
tree60d9d1e583a232e729f965670b2e21dd14a6bc84 /sound/soc/fsl/imx-pcm-fiq.c
parent10eeb5e645b5332b24986a554046f6c9cc2c22d4 (diff)
parentb8a943e2942296aad37a8e7adc43db493413e54b (diff)
Merge branch 'bpf-lpm'
Daniel Mack says: ==================== bpf: add longest prefix match map This patch set adds a longest prefix match algorithm that can be used to match IP addresses to a stored set of ranges. It is exposed as a bpf map type. Internally, data is stored in an unbalanced tree of nodes that has a maximum height of n, where n is the prefixlen the trie was created with. Note that this has nothing to do with fib or fib6 and is in no way meant to replace or share code with it. It's rather a much simpler implementation that is specifically written with bpf maps in mind. Patch 1/2 adds the implementation, 2/2 an extensive test suite and 3/3 has benchmarking code for the new trie type. Feedback is much appreciated. Changelog: v3 -> v4: * David added a 3rd patch that augments map_perf_test for LPM trie benchmarks * Limit allocation of maps of this new type to CAP_SYS_ADMIN for now, as requested by Alexei * Add a stub .map_delete_elem so the core does not stumble over a NULL pointer when the syscall is invoked * Tests for non-power-of-2 prefix lengths were added * More comment style fixes v2 -> v3: * Store both the key match data and the caller provided value in the same byte array attached to a node. This avoids double allocations * Bring back node->flags to distinguish between 'real' and intermediate nodes * Fix comment style and some typos v1 -> v2: * Turn spin lock into raw spinlock * Lock with irqsave options during trie_update_elem() * Return -ENOMEM properly from trie_alloc() * Force attr->flags == BPF_F_NO_PREALLOC during creation * Set trie->map.pages after creation to account for map memory * Allow arbitrary value sizes * Removed node->flags and denode intermediate nodes through node->value == NULL instead rfc -> v1: * Add __rcu pointer annotations to make sparse happy * Fold _lpm_trie_find_target_node() into its only caller * Fix some minor documentation issues ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'sound/soc/fsl/imx-pcm-fiq.c')