diff options
-rw-r--r-- | include/net/caif/cfpkt.h | 1 | ||||
-rw-r--r-- | net/caif/caif_socket.c | 4 | ||||
-rw-r--r-- | net/caif/cfcnfg.c | 1 | ||||
-rw-r--r-- | net/caif/cfpkt_skbuff.c | 27 | ||||
-rw-r--r-- | net/caif/chnl_net.c | 5 |
5 files changed, 13 insertions, 25 deletions
diff --git a/include/net/caif/cfpkt.h b/include/net/caif/cfpkt.h index 8b550f8950d7..6bd200a4754a 100644 --- a/include/net/caif/cfpkt.h +++ b/include/net/caif/cfpkt.h | |||
@@ -195,5 +195,4 @@ void *cfpkt_tonative(struct cfpkt *pkt); | |||
195 | * @return Packet information | 195 | * @return Packet information |
196 | */ | 196 | */ |
197 | struct caif_payload_info *cfpkt_info(struct cfpkt *pkt); | 197 | struct caif_payload_info *cfpkt_info(struct cfpkt *pkt); |
198 | /*! @} */ | ||
199 | #endif /* CFPKT_H_ */ | 198 | #endif /* CFPKT_H_ */ |
diff --git a/net/caif/caif_socket.c b/net/caif/caif_socket.c index 5cf9c73a4078..b840395ced1d 100644 --- a/net/caif/caif_socket.c +++ b/net/caif/caif_socket.c | |||
@@ -205,7 +205,7 @@ static int caif_sktrecv_cb(struct cflayer *layr, struct cfpkt *pkt) | |||
205 | skb = cfpkt_tonative(pkt); | 205 | skb = cfpkt_tonative(pkt); |
206 | 206 | ||
207 | if (unlikely(cf_sk->sk.sk_state != CAIF_CONNECTED)) { | 207 | if (unlikely(cf_sk->sk.sk_state != CAIF_CONNECTED)) { |
208 | cfpkt_destroy(pkt); | 208 | kfree_skb(skb); |
209 | return 0; | 209 | return 0; |
210 | } | 210 | } |
211 | caif_queue_rcv_skb(&cf_sk->sk, skb); | 211 | caif_queue_rcv_skb(&cf_sk->sk, skb); |
@@ -537,7 +537,7 @@ static int transmit_skb(struct sk_buff *skb, struct caifsock *cf_sk, | |||
537 | struct cfpkt *pkt; | 537 | struct cfpkt *pkt; |
538 | 538 | ||
539 | pkt = cfpkt_fromnative(CAIF_DIR_OUT, skb); | 539 | pkt = cfpkt_fromnative(CAIF_DIR_OUT, skb); |
540 | memset(cfpkt_info(pkt), 0, sizeof(struct caif_payload_info)); | 540 | memset(skb->cb, 0, sizeof(struct caif_payload_info)); |
541 | 541 | ||
542 | if (cf_sk->layer.dn == NULL) | 542 | if (cf_sk->layer.dn == NULL) |
543 | return -EINVAL; | 543 | return -EINVAL; |
diff --git a/net/caif/cfcnfg.c b/net/caif/cfcnfg.c index 423009918f79..351c2ca7e7b9 100644 --- a/net/caif/cfcnfg.c +++ b/net/caif/cfcnfg.c | |||
@@ -117,7 +117,6 @@ out_of_mem: | |||
117 | kfree(this); | 117 | kfree(this); |
118 | return NULL; | 118 | return NULL; |
119 | } | 119 | } |
120 | EXPORT_SYMBOL(cfcnfg_create); | ||
121 | 120 | ||
122 | void cfcnfg_remove(struct cfcnfg *cfg) | 121 | void cfcnfg_remove(struct cfcnfg *cfg) |
123 | { | 122 | { |
diff --git a/net/caif/cfpkt_skbuff.c b/net/caif/cfpkt_skbuff.c index 20c6cb3522e0..75d4bfae1a78 100644 --- a/net/caif/cfpkt_skbuff.c +++ b/net/caif/cfpkt_skbuff.c | |||
@@ -97,21 +97,20 @@ inline struct cfpkt *cfpkt_create(u16 len) | |||
97 | { | 97 | { |
98 | return cfpkt_create_pfx(len + PKT_POSTFIX, PKT_PREFIX); | 98 | return cfpkt_create_pfx(len + PKT_POSTFIX, PKT_PREFIX); |
99 | } | 99 | } |
100 | EXPORT_SYMBOL(cfpkt_create); | ||
101 | 100 | ||
102 | void cfpkt_destroy(struct cfpkt *pkt) | 101 | void cfpkt_destroy(struct cfpkt *pkt) |
103 | { | 102 | { |
104 | struct sk_buff *skb = pkt_to_skb(pkt); | 103 | struct sk_buff *skb = pkt_to_skb(pkt); |
105 | kfree_skb(skb); | 104 | kfree_skb(skb); |
106 | } | 105 | } |
107 | EXPORT_SYMBOL(cfpkt_destroy); | 106 | |
108 | 107 | ||
109 | inline bool cfpkt_more(struct cfpkt *pkt) | 108 | inline bool cfpkt_more(struct cfpkt *pkt) |
110 | { | 109 | { |
111 | struct sk_buff *skb = pkt_to_skb(pkt); | 110 | struct sk_buff *skb = pkt_to_skb(pkt); |
112 | return skb->len > 0; | 111 | return skb->len > 0; |
113 | } | 112 | } |
114 | EXPORT_SYMBOL(cfpkt_more); | 113 | |
115 | 114 | ||
116 | int cfpkt_peek_head(struct cfpkt *pkt, void *data, u16 len) | 115 | int cfpkt_peek_head(struct cfpkt *pkt, void *data, u16 len) |
117 | { | 116 | { |
@@ -123,7 +122,6 @@ int cfpkt_peek_head(struct cfpkt *pkt, void *data, u16 len) | |||
123 | return !cfpkt_extr_head(pkt, data, len) && | 122 | return !cfpkt_extr_head(pkt, data, len) && |
124 | !cfpkt_add_head(pkt, data, len); | 123 | !cfpkt_add_head(pkt, data, len); |
125 | } | 124 | } |
126 | EXPORT_SYMBOL(cfpkt_peek_head); | ||
127 | 125 | ||
128 | int cfpkt_extr_head(struct cfpkt *pkt, void *data, u16 len) | 126 | int cfpkt_extr_head(struct cfpkt *pkt, void *data, u16 len) |
129 | { | 127 | { |
@@ -148,7 +146,6 @@ int cfpkt_extr_head(struct cfpkt *pkt, void *data, u16 len) | |||
148 | memcpy(data, from, len); | 146 | memcpy(data, from, len); |
149 | return 0; | 147 | return 0; |
150 | } | 148 | } |
151 | EXPORT_SYMBOL(cfpkt_extr_head); | ||
152 | 149 | ||
153 | int cfpkt_extr_trail(struct cfpkt *pkt, void *dta, u16 len) | 150 | int cfpkt_extr_trail(struct cfpkt *pkt, void *dta, u16 len) |
154 | { | 151 | { |
@@ -171,13 +168,13 @@ int cfpkt_extr_trail(struct cfpkt *pkt, void *dta, u16 len) | |||
171 | memcpy(data, from, len); | 168 | memcpy(data, from, len); |
172 | return 0; | 169 | return 0; |
173 | } | 170 | } |
174 | EXPORT_SYMBOL(cfpkt_extr_trail); | 171 | |
175 | 172 | ||
176 | int cfpkt_pad_trail(struct cfpkt *pkt, u16 len) | 173 | int cfpkt_pad_trail(struct cfpkt *pkt, u16 len) |
177 | { | 174 | { |
178 | return cfpkt_add_body(pkt, NULL, len); | 175 | return cfpkt_add_body(pkt, NULL, len); |
179 | } | 176 | } |
180 | EXPORT_SYMBOL(cfpkt_pad_trail); | 177 | |
181 | 178 | ||
182 | int cfpkt_add_body(struct cfpkt *pkt, const void *data, u16 len) | 179 | int cfpkt_add_body(struct cfpkt *pkt, const void *data, u16 len) |
183 | { | 180 | { |
@@ -226,13 +223,11 @@ int cfpkt_add_body(struct cfpkt *pkt, const void *data, u16 len) | |||
226 | memcpy(to, data, len); | 223 | memcpy(to, data, len); |
227 | return 0; | 224 | return 0; |
228 | } | 225 | } |
229 | EXPORT_SYMBOL(cfpkt_add_body); | ||
230 | 226 | ||
231 | inline int cfpkt_addbdy(struct cfpkt *pkt, u8 data) | 227 | inline int cfpkt_addbdy(struct cfpkt *pkt, u8 data) |
232 | { | 228 | { |
233 | return cfpkt_add_body(pkt, &data, 1); | 229 | return cfpkt_add_body(pkt, &data, 1); |
234 | } | 230 | } |
235 | EXPORT_SYMBOL(cfpkt_addbdy); | ||
236 | 231 | ||
237 | int cfpkt_add_head(struct cfpkt *pkt, const void *data2, u16 len) | 232 | int cfpkt_add_head(struct cfpkt *pkt, const void *data2, u16 len) |
238 | { | 233 | { |
@@ -259,20 +254,20 @@ int cfpkt_add_head(struct cfpkt *pkt, const void *data2, u16 len) | |||
259 | memcpy(to, data, len); | 254 | memcpy(to, data, len); |
260 | return 0; | 255 | return 0; |
261 | } | 256 | } |
262 | EXPORT_SYMBOL(cfpkt_add_head); | 257 | |
263 | 258 | ||
264 | inline int cfpkt_add_trail(struct cfpkt *pkt, const void *data, u16 len) | 259 | inline int cfpkt_add_trail(struct cfpkt *pkt, const void *data, u16 len) |
265 | { | 260 | { |
266 | return cfpkt_add_body(pkt, data, len); | 261 | return cfpkt_add_body(pkt, data, len); |
267 | } | 262 | } |
268 | EXPORT_SYMBOL(cfpkt_add_trail); | 263 | |
269 | 264 | ||
270 | inline u16 cfpkt_getlen(struct cfpkt *pkt) | 265 | inline u16 cfpkt_getlen(struct cfpkt *pkt) |
271 | { | 266 | { |
272 | struct sk_buff *skb = pkt_to_skb(pkt); | 267 | struct sk_buff *skb = pkt_to_skb(pkt); |
273 | return skb->len; | 268 | return skb->len; |
274 | } | 269 | } |
275 | EXPORT_SYMBOL(cfpkt_getlen); | 270 | |
276 | 271 | ||
277 | inline u16 cfpkt_iterate(struct cfpkt *pkt, | 272 | inline u16 cfpkt_iterate(struct cfpkt *pkt, |
278 | u16 (*iter_func)(u16, void *, u16), | 273 | u16 (*iter_func)(u16, void *, u16), |
@@ -290,7 +285,7 @@ inline u16 cfpkt_iterate(struct cfpkt *pkt, | |||
290 | } | 285 | } |
291 | return iter_func(data, pkt->skb.data, cfpkt_getlen(pkt)); | 286 | return iter_func(data, pkt->skb.data, cfpkt_getlen(pkt)); |
292 | } | 287 | } |
293 | EXPORT_SYMBOL(cfpkt_iterate); | 288 | |
294 | 289 | ||
295 | int cfpkt_setlen(struct cfpkt *pkt, u16 len) | 290 | int cfpkt_setlen(struct cfpkt *pkt, u16 len) |
296 | { | 291 | { |
@@ -315,7 +310,6 @@ int cfpkt_setlen(struct cfpkt *pkt, u16 len) | |||
315 | 310 | ||
316 | return cfpkt_getlen(pkt); | 311 | return cfpkt_getlen(pkt); |
317 | } | 312 | } |
318 | EXPORT_SYMBOL(cfpkt_setlen); | ||
319 | 313 | ||
320 | struct cfpkt *cfpkt_append(struct cfpkt *dstpkt, | 314 | struct cfpkt *cfpkt_append(struct cfpkt *dstpkt, |
321 | struct cfpkt *addpkt, | 315 | struct cfpkt *addpkt, |
@@ -357,7 +351,6 @@ struct cfpkt *cfpkt_append(struct cfpkt *dstpkt, | |||
357 | dst->len += addlen; | 351 | dst->len += addlen; |
358 | return skb_to_pkt(dst); | 352 | return skb_to_pkt(dst); |
359 | } | 353 | } |
360 | EXPORT_SYMBOL(cfpkt_append); | ||
361 | 354 | ||
362 | struct cfpkt *cfpkt_split(struct cfpkt *pkt, u16 pos) | 355 | struct cfpkt *cfpkt_split(struct cfpkt *pkt, u16 pos) |
363 | { | 356 | { |
@@ -395,17 +388,13 @@ struct cfpkt *cfpkt_split(struct cfpkt *pkt, u16 pos) | |||
395 | skb2->len += len2nd; | 388 | skb2->len += len2nd; |
396 | return skb_to_pkt(skb2); | 389 | return skb_to_pkt(skb2); |
397 | } | 390 | } |
398 | EXPORT_SYMBOL(cfpkt_split); | ||
399 | 391 | ||
400 | bool cfpkt_erroneous(struct cfpkt *pkt) | 392 | bool cfpkt_erroneous(struct cfpkt *pkt) |
401 | { | 393 | { |
402 | return cfpkt_priv(pkt)->erronous; | 394 | return cfpkt_priv(pkt)->erronous; |
403 | } | 395 | } |
404 | EXPORT_SYMBOL(cfpkt_erroneous); | ||
405 | |||
406 | 396 | ||
407 | struct caif_payload_info *cfpkt_info(struct cfpkt *pkt) | 397 | struct caif_payload_info *cfpkt_info(struct cfpkt *pkt) |
408 | { | 398 | { |
409 | return (struct caif_payload_info *)&pkt_to_skb(pkt)->cb; | 399 | return (struct caif_payload_info *)&pkt_to_skb(pkt)->cb; |
410 | } | 400 | } |
411 | EXPORT_SYMBOL(cfpkt_info); | ||
diff --git a/net/caif/chnl_net.c b/net/caif/chnl_net.c index 1a3398a89aee..649ebacaf6bc 100644 --- a/net/caif/chnl_net.c +++ b/net/caif/chnl_net.c | |||
@@ -83,10 +83,11 @@ static int chnl_recv_cb(struct cflayer *layr, struct cfpkt *pkt) | |||
83 | if (!priv) | 83 | if (!priv) |
84 | return -EINVAL; | 84 | return -EINVAL; |
85 | 85 | ||
86 | skb = (struct sk_buff *) cfpkt_tonative(pkt); | ||
87 | |||
86 | /* Get length of CAIF packet. */ | 88 | /* Get length of CAIF packet. */ |
87 | pktlen = cfpkt_getlen(pkt); | 89 | pktlen = skb->len; |
88 | 90 | ||
89 | skb = (struct sk_buff *) cfpkt_tonative(pkt); | ||
90 | /* Pass some minimum information and | 91 | /* Pass some minimum information and |
91 | * send the packet to the net stack. | 92 | * send the packet to the net stack. |
92 | */ | 93 | */ |