#ifndef TRAFGEN_PROTO_H #define TRAFGEN_PROTO_H #include #include #include enum proto_id { PROTO_NONE = 0, PROTO_ETH, PROTO_PAUSE, PROTO_PFC, PROTO_VLAN, PROTO_ARP, PROTO_MPLS, PROTO_IP4, PROTO_ICMP4, PROTO_IP6, PROTO_ICMP6, PROTO_UDP, PROTO_TCP, __PROTO_MAX, }; enum proto_layer { PROTO_L0, /* invalid layer */ PROTO_L2, PROTO_L3, PROTO_L4, }; struct proto_field; struct proto_hdr; struct proto_ops { enum proto_id id; enum proto_layer layer; void (*header_init)(struct proto_hdr *hdr); void (*header_finish)(struct proto_hdr *hdr); void (*field_changed)(struct proto_field *field); void (*packet_finish)(struct proto_hdr *hdr); void (*packet_update)(struct proto_hdr *hdr); void (*set_next_proto)(struct proto_hdr *hdr, enum proto_id pid); }; struct proto_hdr { const struct proto_ops *ops; uint16_t pkt_offset; uint32_t pkt_id; uint32_t index; struct proto_field *fields; size_t fields_count; bool is_csum_valid; size_t len; }; enum proto_field_func_t { PROTO_FIELD_FUNC_INC = 1 << 0, PROTO_FIELD_FUNC_MIN = 1 << 1, PROTO_FIELD_FUNC_RND = 1 << 2, }; struct proto_field_func { enum proto_field_func_t type; uint32_t min; uint32_t max; int32_t inc; uint32_t val; void (*update_field)(struct proto_field *field); }; struct proto_field { uint32_t id; size_t len; uint32_t shift; uint32_t mask; /* might be negative (e.g. VLAN TPID field) */ int16_t offset; struct proto_field_func func; bool is_set; uint16_t pkt_offset; struct proto_hdr *hdr; }; extern void protos_init(const char *dev); extern void proto_ops_register(const struct proto_ops *ops); extern struct proto_hdr *proto_header_push(enum proto_id pid); extern void proto_header_finish(struct proto_hdr *hdr); extern void proto_packet_finish(void); extern void proto_packet_update(uint32_t idx); extern struct proto_hdr *proto_lower_default_add(struct proto_hdr *hdr, enum proto_id pid); extern struct proto_hdr *proto_lower_header(struct proto_hdr *hdr); extern struct proto_hdr *proto_upper_header(struct proto_hdr *hdr); extern uint8_t *proto_header_ptr(struct proto_hdr *hdr); extern void proto_header_fields_add(struct proto_hdr *hdr, const struct proto_field *fields, size_t count); extern bool proto_field_is_set(struct proto_hdr *hdr, uint32_t fid); extern void proto_field_set_bytes(struct proto_hdr *hdr, uint32_t fid, const uint8_t *bytes); extern void proto_field_set_u8(struct proto_hdr *hdr, uint32_t fid, uint8_t val); extern uint8_t proto_field_get_u8(struct proto_hdr *hdr, uint32_t fid); extern void proto_field_set_u16(struct proto_hdr *hdr, uint32_t fid, uint16_t val); extern uint16_t proto_field_get_u16(struct proto_hdr *hdr, uint32_t fid); extern void proto_field_set_u32(struct proto_hdr *hdr, uint32_t fid, uint32_t val); extern uint32_t proto_field_get_u32(struct proto_hdr *hdr, uint32_t fid); extern void proto_field_set_default_bytes(struct proto_hdr *hdr, uint32_t fid, const uint8_t *bytes); extern void proto_field_set_default_u8(struct proto_hdr *hdr, uint32_t fid, uint8_t val); extern void proto_field_set_default_u16(struct proto_hdr *hdr, uint32_t fid, uint16_t val); extern void proto_field_set_default_u32(struct proto_hdr *hdr, uint32_t fid, uint32_t val); extern void proto_field_set_be16(struct proto_hdr *hdr, uint32_t fid, uint16_t val); extern void proto_field_set_be32(struct proto_hdr *hdr, uint32_t fid, uint32_t val); extern void proto_field_set_default_be16(struct proto_hdr *hdr, uint32_t fid, uint16_t val); extern void proto_field_set_default_be32(struct proto_hdr *hdr, uint32_t fid, uint32_t val); extern void proto_field_set_dev_mac(struct proto_hdr *hdr, uint32_t fid); extern void proto_field_set_default_dev_mac(struct proto_hdr *hdr, uint32_t fid); extern void proto_field_set_dev_ipv4(struct proto_hdr *hdr, uint32_t fid); extern void proto_field_set_default_dev_ipv4(struct proto_hdr *hdr, uint32_t fid); extern void proto_field_set_dev_ipv6(struct proto_hdr *hdr, uint32_t fid); extern void proto_field_set_default_dev_ipv6(struct proto_hdr *hdr, uint32_t fid); extern void proto_field_dyn_apply(struct proto_field *field); extern void proto_field_func_add(struct proto_hdr *hdr, uint32_t fid, struct proto_field_func *func); extern struct proto_field *proto_field_by_id(struct proto_hdr *hdr, uint32_t fid); #endif /* TRAFGEN_PROTO_H */ ass='commit-info'> authorStanislaw Gruszka <sgruszka@redhat.com>2017-01-29 12:40:52 +0100 committerKalle Valo <kvalo@codeaurora.org>2017-01-31 09:08:52 +0200 commit33e962c8871f015f5c8978384553dddcf5b81b22 (patch) tree43aff96c2ee21d9e0fa2018457778a4de52053cd /include/net/dsa.h parent575ddce0507789bf9830d089557d2199d2f91865 (diff)
rt2x00: fix clk_get call
clk_get() takes two arguments and might return ERR_PTR(), so we have to nullify pointer on that case, to do not break further call to clk_get_rate(). Reported-by: Felix Fietkau <nbd@nbd.name> Fixes: 34db70b92fae ("rt2x00: add copy of clk for soc devices") Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'include/net/dsa.h')
8af7b198b93217746f9a506ee8a'>586655d278ba08af7b198b93217746f9a506ee8a (diff)
Merge tag 'rtc-4.10-2' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux
Pull RTC fix from Alexandre Belloni: "A single fix for this cycle. It is worth taking it for 4.10 so that distributions will not have CONFIG_RTC_DRV_JZ4740 switching from m to y in their config. Summary: - Allow jz4740 to build as a module again by using kernel_halt()" * tag 'rtc-4.10-2' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: rtc: jz4740: make the driver buildable as a module again
Diffstat (limited to 'include/dt-bindings/clock/lpc18xx-cgu.h')