Lines Matching refs:rfml

37 	struct cfrfml *rfml = container_obj(&srvl->layer);  in cfrfml_release()  local
39 if (rfml->incomplete_frm) in cfrfml_release()
40 cfpkt_destroy(rfml->incomplete_frm); in cfrfml_release()
74 static struct cfpkt *rfm_append(struct cfrfml *rfml, char *seghead, in rfm_append() argument
85 if (memcmp(seghead, rfml->seghead, 6) != 0) in rfm_append()
88 tmppkt = cfpkt_append(rfml->incomplete_frm, pkt, in rfm_append()
89 rfml->pdu_size + RFM_HEAD_SIZE); in rfm_append()
106 struct cfrfml *rfml; in cfrfml_receive() local
111 rfml = container_obj(layr); in cfrfml_receive()
112 spin_lock(&rfml->sync); in cfrfml_receive()
120 if (rfml->incomplete_frm == NULL) { in cfrfml_receive()
122 if (cfpkt_peek_head(pkt, rfml->seghead, 6) < 0) in cfrfml_receive()
125 rfml->pdu_size = get_unaligned_le16(rfml->seghead+4); in cfrfml_receive()
129 rfml->incomplete_frm = pkt; in cfrfml_receive()
133 tmppkt = rfm_append(rfml, seghead, pkt, &err); in cfrfml_receive()
140 rfml->incomplete_frm = tmppkt; in cfrfml_receive()
150 if (rfml->incomplete_frm) { in cfrfml_receive()
153 tmppkt = rfm_append(rfml, seghead, pkt, &err); in cfrfml_receive()
160 rfml->incomplete_frm = NULL; in cfrfml_receive()
166 if (rfml->pdu_size != cfpkt_getlen(pkt) - RFM_HEAD_SIZE + 1) in cfrfml_receive()
170 err = rfml->serv.layer.up->receive(rfml->serv.layer.up, pkt); in cfrfml_receive()
179 if (rfml->incomplete_frm) in cfrfml_receive()
180 cfpkt_destroy(rfml->incomplete_frm); in cfrfml_receive()
181 rfml->incomplete_frm = NULL; in cfrfml_receive()
187 rfml->serv.dev_info.id); in cfrfml_receive()
189 spin_unlock(&rfml->sync); in cfrfml_receive()
194 static int cfrfml_transmit_segment(struct cfrfml *rfml, struct cfpkt *pkt) in cfrfml_transmit_segment() argument
196 caif_assert(cfpkt_getlen(pkt) < rfml->fragment_size); in cfrfml_transmit_segment()
199 cfpkt_info(pkt)->channel_id = rfml->serv.layer.id; in cfrfml_transmit_segment()
206 cfpkt_info(pkt)->dev_info = &rfml->serv.dev_info; in cfrfml_transmit_segment()
208 return rfml->serv.layer.dn->transmit(rfml->serv.layer.dn, pkt); in cfrfml_transmit_segment()
218 struct cfrfml *rfml = container_obj(layr); in cfrfml_transmit() local
223 if (!cfsrvl_ready(&rfml->serv, &err)) in cfrfml_transmit()
231 if (cfpkt_getlen(pkt) > rfml->fragment_size + RFM_HEAD_SIZE) in cfrfml_transmit()
237 while (cfpkt_getlen(frontpkt) > rfml->fragment_size + RFM_HEAD_SIZE) { in cfrfml_transmit()
251 rearpkt = cfpkt_split(frontpkt, rfml->fragment_size); in cfrfml_transmit()
255 err = cfrfml_transmit_segment(rfml, frontpkt); in cfrfml_transmit()
277 err = cfrfml_transmit_segment(rfml, frontpkt); in cfrfml_transmit()
287 rfml->serv.dev_info.id); in cfrfml_transmit()