/* * Apple Onboard Audio definitions * * Copyright 2006 Johannes Berg * * GPL v2, can be found in COPYING. */ #ifndef __AOA_H #define __AOA_H #include #include #include #include #include #include "aoa-gpio.h" #include "soundbus/soundbus.h" #define MAX_CODEC_NAME_LEN 32 struct aoa_codec { char name[MAX_CODEC_NAME_LEN]; struct module *owner; /* called when the fabric wants to init this codec. * Do alsa card manipulations from here. */ int (*init)(struct aoa_codec *codec); /* called when the fabric is done with the codec. * The alsa card will be cleaned up so don't bother. */ void (*exit)(struct aoa_codec *codec); /* May be NULL, but can be used by the fabric. * Refcounting is the codec driver's responsibility */ struct device_node *node; /* assigned by fabric before init() is called, points * to the soundbus device. Cannot be NULL. */ struct soundbus_dev *soundbus_dev; /* assigned by the fabric before init() is called, points * to the fabric's gpio runtime record for the relevant * device. */ struct gpio_runtime *gpio; /* assigned by the fabric before init() is called, contains * a codec specific bitmask of what outputs and inputs are * actually connected */ u32 connected; /* data the fabric can associate with this structure */ void *fabric_data; /* private! */ struct list_head list; struct aoa_fabric *fabric; }; /* return 0 on success */ extern int aoa_codec_register(struct aoa_codec *codec); extern void aoa_codec_unregister(struct aoa_codec *codec); #define MAX_LAYOUT_NAME_LEN 32 struct aoa_fabric { char name[MAX_LAYOUT_NAME_LEN]; struct module *owner; /* once codecs register, they are passed here after. * They are of course not initialised, since the * fabric is responsible for initialising some fields * in the codec structure! */ int (*found_codec)(struct aoa_codec *codec); /* called for each codec when it is removed, * also in the case that aoa_fabric_unregister * is called and all codecs are removed * from this fabric. * Also called if found_codec returned 0 but * the codec couldn't initialise. */ void (*remove_codec)(struct aoa_codec *codec); /* If found_codec returned 0, and the codec * could be initialised, this is called. */ void (*attached_codec)(struct aoa_codec *codec); }; /* return 0 on success, -EEXIST if another fabric is * registered, -EALREADY if the same fabric is registered. * Passing NULL can be used to test for the presence * of another fabric, if -EALREADY is returned there is * no other fabric present. * In the case that the function returns -EALREADY * and the fabric passed is not NULL, all codecs * that are not assigned yet are passed to the fabric * again for reconsideration. */ extern int aoa_fabric_register(struct aoa_fabric *fabric, struct device *dev); /* it is vital to call this when the fabric exits! * When calling, the remove_codec will be called * for all codecs, unless it is NULL. */ extern void aoa_fabric_unregister(struct aoa_fabric *fabric); /* if for some reason you want to get rid of a codec * before the fabric is removed, use this. * Note that remove_codec is called for it! */ extern void aoa_fabric_unlink_codec(struct aoa_codec *codec); /* alsa help methods */ struct aoa_card { struct snd_card *alsa_card; }; extern int aoa_snd_device_new(enum snd_device_type type, void * device_data, struct snd_device_ops * ops); extern struct snd_card *aoa_get_card(void); extern int aoa_snd_ctl_add(struct snd_kcontrol* control); /* GPIO stuff */ extern struct gpio_methods *pmf_gpio_methods; extern struct gpio_methods *ftr_gpio_methods; /* extern struct gpio_methods *map_gpio_methods; */ #endif /* __AOA_H */ hes will add a new flood table, and without it, it will increase the overall size of the flood tables dramatically. Signed-off-by: Nogah Frankel <nogahf@mellanox.com> Signed-off-by: Yotam Gigi <yotamg@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net> 2017-02-10mlxsw: spectrum: Make port flood update more genericNogah Frankel1-13/+13 Currently, there is a per port flood update function only for the UC table. Make the function more generic by changing the table type to be an input. Signed-off-by: Nogah Frankel <nogahf@mellanox.com> Signed-off-by: Yotam Gigi <yotamg@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net> 2017-02-10mlxsw: spectrum: Break flood set func to be per tableNogah Frankel1-20/+34 Currently, the flood set function can't operate on only one table, but sets both uc_flood and mb_flood together. This patch creates a function that sets the flood state per table. Signed-off-by: Nogah Frankel <nogahf@mellanox.com> Signed-off-by: Yotam Gigi <yotamg@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net> 2017-02-10switchdev: bridge: Offload mc router portsNogah Frankel2-0/+17 Offload the mc router ports list, whenever it is being changed. It is done because in some cases mc packets needs to be flooded to all the ports in this list. Signed-off-by: Nogah Frankel <nogahf@mellanox.com> Signed-off-by: Yotam Gigi <yotamg@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Acked-by: Ivan Vecera <ivecera@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net> 2017-02-10bridge: mcast: Merge the mc router ports deletions to one functionNogah Frankel1-15/+9 There are three places where a port gets deleted from the mc router port list. This patch join the actual deletion to one function. It will be helpful for later patch that will offload changes in the mc router ports list. Signed-off-by: Nogah Frankel <nogahf@mellanox.com> Signed-off-by: Yotam Gigi <yotamg@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Acked-by: Ivan Vecera <ivecera@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net> 2017-02-10switchdev: bridge: Offload multicast disabledNogah Frankel2-0/+18 Offload multicast disabled flag, for more accurate mc flood behavior: When it is on, the mdb should be ignored. When it is off, unregistered mc packets should be flooded to mc router ports. Signed-off-by: Nogah Frankel <nogahf@mellanox.com> Signed-off-by: Yotam Gigi <yotamg@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Acked-by: Ivan Vecera <ivecera@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net> 2017-02-10Merge branch 'sched-cls_api-small-cleanup'David S. Miller15-104/+126 Jiri Pirko says: ==================== sched: cls_api: small cleanup This patchset makes couple of things in cls_api code a bit nicer and easier for reader to digest. ==================== Signed-off-by: David S. Miller <davem@davemloft.net> 2017-02-10sched: check negative err value to safe one level of indentJiri Pirko1-13/+9 As it is more common, check err for !0. That allows to safe one level of indentation and makes the code easier to read. Also, make 'next' variable global in function as it is used twice. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Acked-by: Jamal Hadi Salim <jhs@mojatatu.com> Signed-off-by: David S. Miller <davem@davemloft.net> 2017-02-10sched: add missing curly braces in else branch in tc_ctl_tfilterJiri Pirko1-1/+2 Curly braces need to be there, for stylistic reasons. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Acked-by: Jamal Hadi Salim <jhs@mojatatu.com> Signed-off-by: David S. Miller <davem@davemloft.net> 2017-02-10sched: move err set right before goto errout in tc_ctl_tfilterJiri Pirko1-10/+19 This makes the reader to know right away what is the error value. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Acked-by: Jamal Hadi Salim <jhs@mojatatu.com> Signed-off-by: David S. Miller <davem@davemloft.net> 2017-02-10sched: push TC filter protocol creation into a separate functionJiri Pirko1-51/+59 Make the long function tc_ctl_tfilter a little bit shorter and easier to read. Also make the creation of filter proto symmetric to destruction. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Acked-by: Jamal Hadi Salim <jhs@mojatatu.com> Signed-off-by: David S. Miller <davem@davemloft.net> 2017-02-10sched: move tcf_proto_destroy and tcf_destroy_chain helpers into cls_apiJiri Pirko15-26/+34 Creation is done in this file, move destruction to be at the same place. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Acked-by: Jamal Hadi Salim <jhs@mojatatu.com> Signed-off-by: David S. Miller <davem@davemloft.net> 2017-02-10sched: rename tcf_destroy to tcf_destroy_protoJiri Pirko3-7/+7 This function destroys TC filter protocol, not TC filter. So name it accordingly. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Acked-by: Jamal Hadi Salim <jhs@mojatatu.com> Signed-off-by: David S. Miller <davem@davemloft.net> 2017-02-10Merge branch 'mlxsw-identical-routes-handling'David S. Miller