Lines Matching +full:- +full:eproto
1 // SPDX-License-Identifier: GPL-2.0-only
5 * Copyright (C) ST-Ericsson AB 2010
14 #include <linux/crc-ccitt.h>
40 this->pcpu_refcnt = alloc_percpu(int); in cffrml_create()
41 if (this->pcpu_refcnt == NULL) { in cffrml_create()
48 this->layer.receive = cffrml_receive; in cffrml_create()
49 this->layer.transmit = cffrml_transmit; in cffrml_create()
50 this->layer.ctrlcmd = cffrml_ctrlcmd; in cffrml_create()
51 snprintf(this->layer.name, CAIF_LAYER_NAME_SZ, "frm%d", phyid); in cffrml_create()
52 this->dofcs = use_fcs; in cffrml_create()
53 this->layer.id = phyid; in cffrml_create()
60 free_percpu(this->pcpu_refcnt); in cffrml_free()
66 this->up = up; in cffrml_set_uplayer()
71 this->dn = dn; in cffrml_set_dnlayer()
76 /* FIXME: FCS should be moved to glue in order to use OS-Specific in cffrml_checksum()
95 if (!this->dofcs) in cffrml_receive()
96 len -= 2; in cffrml_receive()
102 return -EPROTO; in cffrml_receive()
105 * Don't do extract if FCS is false, rather do setlen - then we don't in cffrml_receive()
106 * get a cache-miss. in cffrml_receive()
108 if (this->dofcs) { in cffrml_receive()
118 return -EILSEQ; in cffrml_receive()
125 return -EPROTO; in cffrml_receive()
128 if (layr->up == NULL) { in cffrml_receive()
131 return -EINVAL; in cffrml_receive()
134 return layr->up->receive(layr->up, pkt); in cffrml_receive()
144 if (this->dofcs) { in cffrml_transmit()
154 cfpkt_info(pkt)->hdr_len += 2; in cffrml_transmit()
158 return -EPROTO; in cffrml_transmit()
161 if (layr->dn == NULL) { in cffrml_transmit()
163 return -ENODEV; in cffrml_transmit()
166 return layr->dn->transmit(layr->dn, pkt); in cffrml_transmit()
172 if (layr->up && layr->up->ctrlcmd) in cffrml_ctrlcmd()
173 layr->up->ctrlcmd(layr->up, ctrl, layr->id); in cffrml_ctrlcmd()
179 if (layr != NULL && this->pcpu_refcnt != NULL) in cffrml_put()
180 this_cpu_dec(*this->pcpu_refcnt); in cffrml_put()
186 if (layr != NULL && this->pcpu_refcnt != NULL) in cffrml_hold()
187 this_cpu_inc(*this->pcpu_refcnt); in cffrml_hold()
195 refcnt += *per_cpu_ptr(this->pcpu_refcnt, i); in cffrml_refcnt_read()