7 #define pr_fmt(fmt) KBUILD_MODNAME ":%s(): " fmt, __func__
9 #include <linux/stddef.h>
11 #include <linux/slab.h>
18 #define container_obj(layr) container_of(layr, struct cfmuxl, layer)
20 #define CAIF_CTRL_CHANNEL 0
21 #define UP_CACHE_SIZE 8
22 #define DN_CACHE_SIZE 8
42 static int cfmuxl_receive(
struct cflayer *layr,
struct cfpkt *pkt);
43 static int cfmuxl_transmit(
struct cflayer *layr,
struct cfpkt *pkt);
53 memset(
this, 0,
sizeof(*
this));
54 this->
layer.receive = cfmuxl_receive;
55 this->
layer.transmit = cfmuxl_transmit;
56 this->
layer.ctrlcmd = cfmuxl_ctrlcmd;
78 list_for_each_entry_rcu(lyr, list,
node) {
94 old = get_from_id(&muxl->
srvl_list, linkid);
96 list_del_rcu(&old->
node);
112 dn = get_from_id(&muxl->
frml_list, phyid);
116 list_del_rcu(&dn->
node);
128 if (up ==
NULL || up->
id !=
id) {
142 if (dn ==
NULL || dn->
id != dev_info->
id) {
158 pr_warn(
"Trying to remove control layer\n");
168 list_del_rcu(&up->
node);
174 static int cfmuxl_receive(
struct cflayer *layr,
struct cfpkt *pkt)
181 pr_err(
"erroneous Caif Packet\n");
186 up = get_up(muxl,
id);
189 pr_debug(
"Received data on unknown link ID = %d (0x%x)"
190 " up == NULL",
id,
id);
211 static int cfmuxl_transmit(
struct cflayer *layr,
struct cfpkt *pkt)
224 pr_debug(
"Send data on unknown phy ID = %d (0x%x)\n",
263 layer->
ctrlcmd(layer, ctrl, phyid);