/* Test program for SIOC{G,S}HWTSTAMP * Copyright 2013 Solarflare Communications * Author: Ben Hutchings */ #include #include #include #include #include #include #include #include #include static int lookup_value(const char **names, int size, const char *name) { int value; for (value = 0; value < size; value++) if (names[value] && strcasecmp(names[value], name) == 0) return value; return -1; } static const char * lookup_name(const char **names, int size, int value) { return (value >= 0 && value < size) ? names[value] : NULL; } static void list_names(FILE *f, const char **names, int size) { int value; for (value = 0; value < size; value++) if (names[value]) fprintf(f, " %s\n", names[value]); } static const char *tx_types[] = { #define TX_TYPE(name) [HWTSTAMP_TX_ ## name] = #name TX_TYPE(OFF), TX_TYPE(ON), TX_TYPE(ONESTEP_SYNC) #undef TX_TYPE }; #define N_TX_TYPES ((int)(sizeof(tx_types) / sizeof(tx_types[0]))) static const char *rx_filters[] = { #define RX_FILTER(name) [HWTSTAMP_FILTER_ ## name] = #name RX_FILTER(NONE), RX_FILTER(ALL), RX_FILTER(SOME), RX_FILTER(PTP_V1_L4_EVENT), RX_FILTER(PTP_V1_L4_SYNC), RX_FILTER(PTP_V1_L4_DELAY_REQ), RX_FILTER(PTP_V2_L4_EVENT), RX_FILTER(PTP_V2_L4_SYNC), RX_FILTER(PTP_V2_L4_DELAY_REQ), RX_FILTER(PTP_V2_L2_EVENT), RX_FILTER(PTP_V2_L2_SYNC), RX_FILTER(PTP_V2_L2_DELAY_REQ), RX_FILTER(PTP_V2_EVENT), RX_FILTER(PTP_V2_SYNC), RX_FILTER(PTP_V2_DELAY_REQ), #undef RX_FILTER }; #define N_RX_FILTERS ((int)(sizeof(rx_filters) / sizeof(rx_filters[0]))) static void usage(void) { fputs("Usage: hwtstamp_config if_name [tx_type rx_filter]\n" "tx_type is any of (case-insensitive):\n", stderr); list_names(stderr, tx_types, N_TX_TYPES); fputs("rx_filter is any of (case-insensitive):\n", stderr); list_names(stderr, rx_filters, N_RX_FILTERS); } int main(int argc, char **argv) { struct ifreq ifr; struct hwtstamp_config config; const char *name; int sock; if ((argc != 2 && argc != 4) || (strlen(argv[1]) >= IFNAMSIZ)) { usage(); return 2; } if (argc == 4) { config.flags = 0; config.tx_type = lookup_value(tx_types, N_TX_TYPES, argv[2]); config.rx_filter = lookup_value(rx_filters, N_RX_FILTERS, argv[3]); if (config.tx_type < 0 || config.rx_filter < 0) { usage(); return 2; } } sock = socket(AF_INET, SOCK_DGRAM, 0); if (sock < 0) { perror("socket"); return 1; } strcpy(ifr.ifr_name, argv[1]); ifr.ifr_data = (caddr_t)&config; if (ioctl(sock, (argc == 2) ? SIOCGHWTSTAMP : SIOCSHWTSTAMP, &ifr)) { perror("ioctl"); return 1; } printf("flags = %#x\n", config.flags); name = lookup_name(tx_types, N_TX_TYPES, config.tx_type); if (name) printf("tx_type = %s\n", name); else printf("tx_type = %d\n", config.tx_type); name = lookup_name(rx_filters, N_RX_FILTERS, config.rx_filter); if (name) printf("rx_filter = %s\n", name); else printf("rx_filter = %d\n", config.rx_filter); return 0; } c8e'>Kconfig
pci/ctxfi/ctdaio.c?h=nds-private-remove&id=4205e4786d0b9fc3b4fec7b1910cf645a0468307'>ctdaio.c
diff options
AgeCommit message (Expand)AuthorFilesLines
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2017-01-10 14:01:05 +0100
committerThomas Gleixner <tglx@linutronix.de>2017-01-16 13:20:05 +0100
commit4205e4786d0b9fc3b4fec7b1910cf645a0468307 (patch)
tree685ccb486409197b936c785eb9d173c3edff45a1 /sound/pci/ctxfi/ctdaio.c
parent7e164ce4e8ecd7e9a58a83750bd3ee03125df154 (diff)
cpu/hotplug: Provide dynamic range for prepare stage
Mathieu reported that the LTTNG modules are broken as of 4.10-rc1 due to the removal of the cpu hotplug notifiers. Usually I don't care much about out of tree modules, but LTTNG is widely used in distros. There are two ways to solve that: 1) Reserve a hotplug state for LTTNG 2) Add a dynamic range for the prepare states. While #1 is the simplest solution, #2 is the proper one as we can convert in tree users, which do not care about ordering, to the dynamic range as well. Add a dynamic range which allows LTTNG to request states in the prepare stage. Reported-and-tested-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Sebastian Sewior <bigeasy@linutronix.de> Cc: Steven Rostedt <rostedt@goodmis.org> Link: http://lkml.kernel.org/r/alpine.DEB.2.20.1701101353010.3401@nanos Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'sound/pci/ctxfi/ctdaio.c')