diff options
author | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
---|---|---|
committer | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
commit | c71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch) | |
tree | ecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /net/caif/cfutill.c | |
parent | ea53c912f8a86a8567697115b6a0d8152beee5c8 (diff) | |
parent | 6a00f206debf8a5c8899055726ad127dbeeed098 (diff) |
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts:
litmus/sched_cedf.c
Diffstat (limited to 'net/caif/cfutill.c')
-rw-r--r-- | net/caif/cfutill.c | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/net/caif/cfutill.c b/net/caif/cfutill.c index 02795aff57a4..98e027db18ed 100644 --- a/net/caif/cfutill.c +++ b/net/caif/cfutill.c | |||
@@ -4,6 +4,8 @@ | |||
4 | * License terms: GNU General Public License (GPL) version 2 | 4 | * License terms: GNU General Public License (GPL) version 2 |
5 | */ | 5 | */ |
6 | 6 | ||
7 | #define pr_fmt(fmt) KBUILD_MODNAME ":%s(): " fmt, __func__ | ||
8 | |||
7 | #include <linux/kernel.h> | 9 | #include <linux/kernel.h> |
8 | #include <linux/types.h> | 10 | #include <linux/types.h> |
9 | #include <linux/slab.h> | 11 | #include <linux/slab.h> |
@@ -18,7 +20,7 @@ | |||
18 | #define UTIL_REMOTE_SHUTDOWN 0x82 | 20 | #define UTIL_REMOTE_SHUTDOWN 0x82 |
19 | #define UTIL_FLOW_OFF 0x81 | 21 | #define UTIL_FLOW_OFF 0x81 |
20 | #define UTIL_FLOW_ON 0x80 | 22 | #define UTIL_FLOW_ON 0x80 |
21 | #define UTIL_CTRL_PKT_SIZE 1 | 23 | |
22 | static int cfutill_receive(struct cflayer *layr, struct cfpkt *pkt); | 24 | static int cfutill_receive(struct cflayer *layr, struct cfpkt *pkt); |
23 | static int cfutill_transmit(struct cflayer *layr, struct cfpkt *pkt); | 25 | static int cfutill_transmit(struct cflayer *layr, struct cfpkt *pkt); |
24 | 26 | ||
@@ -26,7 +28,7 @@ struct cflayer *cfutill_create(u8 channel_id, struct dev_info *dev_info) | |||
26 | { | 28 | { |
27 | struct cfsrvl *util = kmalloc(sizeof(struct cfsrvl), GFP_ATOMIC); | 29 | struct cfsrvl *util = kmalloc(sizeof(struct cfsrvl), GFP_ATOMIC); |
28 | if (!util) { | 30 | if (!util) { |
29 | pr_warning("CAIF: %s(): Out of memory\n", __func__); | 31 | pr_warn("Out of memory\n"); |
30 | return NULL; | 32 | return NULL; |
31 | } | 33 | } |
32 | caif_assert(offsetof(struct cfsrvl, layer) == 0); | 34 | caif_assert(offsetof(struct cfsrvl, layer) == 0); |
@@ -47,7 +49,7 @@ static int cfutill_receive(struct cflayer *layr, struct cfpkt *pkt) | |||
47 | caif_assert(layr->up->receive != NULL); | 49 | caif_assert(layr->up->receive != NULL); |
48 | caif_assert(layr->up->ctrlcmd != NULL); | 50 | caif_assert(layr->up->ctrlcmd != NULL); |
49 | if (cfpkt_extr_head(pkt, &cmd, 1) < 0) { | 51 | if (cfpkt_extr_head(pkt, &cmd, 1) < 0) { |
50 | pr_err("CAIF: %s(): Packet is erroneous!\n", __func__); | 52 | pr_err("Packet is erroneous!\n"); |
51 | cfpkt_destroy(pkt); | 53 | cfpkt_destroy(pkt); |
52 | return -EPROTO; | 54 | return -EPROTO; |
53 | } | 55 | } |
@@ -64,16 +66,14 @@ static int cfutill_receive(struct cflayer *layr, struct cfpkt *pkt) | |||
64 | cfpkt_destroy(pkt); | 66 | cfpkt_destroy(pkt); |
65 | return 0; | 67 | return 0; |
66 | case UTIL_REMOTE_SHUTDOWN: /* Remote Shutdown Request */ | 68 | case UTIL_REMOTE_SHUTDOWN: /* Remote Shutdown Request */ |
67 | pr_err("CAIF: %s(): REMOTE SHUTDOWN REQUEST RECEIVED\n", | 69 | pr_err("REMOTE SHUTDOWN REQUEST RECEIVED\n"); |
68 | __func__); | ||
69 | layr->ctrlcmd(layr, CAIF_CTRLCMD_REMOTE_SHUTDOWN_IND, 0); | 70 | layr->ctrlcmd(layr, CAIF_CTRLCMD_REMOTE_SHUTDOWN_IND, 0); |
70 | service->open = false; | 71 | service->open = false; |
71 | cfpkt_destroy(pkt); | 72 | cfpkt_destroy(pkt); |
72 | return 0; | 73 | return 0; |
73 | default: | 74 | default: |
74 | cfpkt_destroy(pkt); | 75 | cfpkt_destroy(pkt); |
75 | pr_warning("CAIF: %s(): Unknown service control %d (0x%x)\n", | 76 | pr_warn("Unknown service control %d (0x%x)\n", cmd, cmd); |
76 | __func__, cmd, cmd); | ||
77 | return -EPROTO; | 77 | return -EPROTO; |
78 | } | 78 | } |
79 | } | 79 | } |
@@ -100,10 +100,5 @@ static int cfutill_transmit(struct cflayer *layr, struct cfpkt *pkt) | |||
100 | */ | 100 | */ |
101 | info->hdr_len = 1; | 101 | info->hdr_len = 1; |
102 | info->dev_info = &service->dev_info; | 102 | info->dev_info = &service->dev_info; |
103 | ret = layr->dn->transmit(layr->dn, pkt); | 103 | return layr->dn->transmit(layr->dn, pkt); |
104 | if (ret < 0) { | ||
105 | u32 tmp32; | ||
106 | cfpkt_extr_head(pkt, &tmp32, 4); | ||
107 | } | ||
108 | return ret; | ||
109 | } | 104 | } |