7 #define pr_fmt(fmt) KBUILD_MODNAME ":%s(): " fmt, __func__
9 #include <linux/kernel.h>
10 #include <linux/types.h>
11 #include <linux/errno.h>
12 #include <linux/slab.h>
13 #include <linux/module.h>
19 #define SRVL_CTRL_PKT_SIZE 1
20 #define SRVL_FLOW_OFF 0x81
21 #define SRVL_FLOW_ON 0x80
22 #define SRVL_SET_PIN 0x82
23 #define SRVL_CTRL_PKT_SIZE 1
25 #define container_obj(layr) container_of(layr, struct cfsrvl, layer)
38 layr->
up->ctrlcmd(layr->
up, ctrl, phyid);
42 service->
open =
false;
43 layr->
up->ctrlcmd(layr->
up, ctrl, phyid);
49 layr->
up->ctrlcmd(layr->
up,
57 layr->
up->ctrlcmd(layr->
up,
65 layr->
up->ctrlcmd(layr->
up,
72 layr->
up->ctrlcmd(layr->
up,
79 layr->
up->ctrlcmd(layr->
up,
83 layr->
up->ctrlcmd(layr->
up, ctrl, phyid);
86 pr_warn(
"Unexpected ctrl in cfsrvl (%d)\n", ctrl);
88 layr->
up->ctrlcmd(layr->
up, ctrl, phyid);
116 pr_err(
"Packet is erroneous!\n");
125 return layr->
dn->transmit(layr->
dn, pkt);
137 pr_err(
"Packet is erroneous!\n");
146 return layr->
dn->transmit(layr->
dn, pkt);
154 static void cfsrvl_release(
struct cflayer *layer)
167 service->
open =
false;
170 service->
layer.id = channel_id;
171 service->
layer.ctrlcmd = cfservl_ctrlcmd;
172 service->
layer.modemcmd = cfservl_modemcmd;
175 service->
release = cfsrvl_release;
180 if (!service->
open) {
202 if (adap_layer ==
NULL || adap_layer->
dn ==
NULL)