12 #define KMSG_COMPONENT "smsgiucv_app"
13 #define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
15 #include <linux/ctype.h>
17 #include <linux/device.h>
18 #include <linux/list.h>
20 #include <linux/module.h>
21 #include <linux/slab.h>
28 #define SMSG_PREFIX "APP"
31 #define ENV_SENDER_STR "SMSG_SENDER="
32 #define ENV_SENDER_LEN (strlen(ENV_SENDER_STR) + 8 + 1)
33 #define ENV_PREFIX_STR "SMSG_ID="
34 #define ENV_PREFIX_LEN (strlen(ENV_PREFIX_STR) + \
35 strlen(SMSG_PREFIX) + 1)
36 #define ENV_TEXT_STR "SMSG_TEXT="
37 #define ENV_TEXT_LEN(msg) (strlen(ENV_TEXT_STR) + strlen((msg)) + 1)
47 static struct device *smsg_app_dev;
106 spin_lock_bh(&smsg_event_queue_lock);
108 spin_unlock_bh(&smsg_event_queue_lock);
113 smsg_app_event_free(p);
118 static DECLARE_WORK(smsg_event_work, smsg_event_work_fn);
120 static void smsg_app_callback(
const char *from,
char *msg)
126 if (sender &&
strlen(sender) > 0 &&
strcmp(from, sender) != 0)
137 se = smsg_app_event_alloc(from, msg);
142 spin_lock(&smsg_event_queue_lock);
144 spin_unlock(&smsg_event_queue_lock);
150 static int __init smsgiucv_app_init(
void)
158 smsg_app_dev = kzalloc(
sizeof(*smsg_app_dev),
GFP_KERNEL);
176 smsg_app_dev->
driver = smsgiucv_drv;
187 sender[len] =
toupper(sender[len]);
203 static void __exit smsgiucv_app_exit(
void)
210 smsg_event_work_fn(&smsg_event_work);