#ifndef TRAFGEN_CONF #define TRAFGEN_CONF #include #include #include #define TYPE_INC 0 #define TYPE_DEC 1 enum csum { CSUM_IP, CSUM_UDP, CSUM_TCP, }; struct counter { int type; uint8_t min, max, inc, val; off_t off; }; struct randomizer { off_t off; }; struct csum16 { off_t off, from, to; enum csum which; }; struct packet { uint8_t *payload; size_t len; }; struct packet_dyn { struct counter *cnt; size_t clen; struct randomizer *rnd; size_t rlen; struct csum16 *csum; size_t slen; }; extern int compile_packets(char *file, int verbose, int cpu, bool invoke_cpp); extern void cleanup_packets(void); #endif /* TRAFGEN_CONF */ ogo' rowspan='2'>cgit logo index : net-next.git
net-next plumbingsTobias Klauser
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2016-10-25 10:47:44 +0900
committerLinus Walleij <linus.walleij@linaro.org>2016-10-31 21:23:44 +0100
commitc7e9d39831a31682285cc31ddf7dd06c0fe59138 (patch)
treef0aec72f2c50ab541c64a7db531aa09dce147b8c
parent953b956a2e6d35298e684f251bad98ea6c96f982 (diff)
gpio: of: fix GPIO drivers with multiple gpio_chip for a single node
Sylvain Lemieux reports the LPC32xx GPIO driver is broken since commit 762c2e46c059 ("gpio: of: remove of_gpiochip_and_xlate() and struct gg_data"). Probably, gpio-etraxfs.c and gpio-davinci.c are broken too. Those drivers register multiple gpio_chip that are associated to a single OF node, and their own .of_xlate() checks if the passed gpio_chip is valid. Now, the problem is of_find_gpiochip_by_node() returns the first gpio_chip found to match the given node. So, .of_xlate() fails, except for the first GPIO bank. Reverting the commit could be a solution, but I do not want to go back to the mess of struct gg_data. Another solution here is to take the match by a node pointer and the success of .of_xlate(). It is a bit clumsy to call .of_xlate twice; for gpio_chip matching and for really getting the gpio_desc index. Perhaps, our long-term goal might be to convert the drivers to single chip registration, but this commit will solve the problem until then. Fixes: 762c2e46c059 ("gpio: of: remove of_gpiochip_and_xlate() and struct gg_data") Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reported-by: Sylvain Lemieux <slemieux.tyco@gmail.com> Tested-by: David Lechner <david@lechnology.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>