Lines Matching refs:frame

121 					       struct hsr_frame_info *frame)  in create_stripped_skb_hsr()  argument
139 if (frame->is_vlan) in create_stripped_skb_hsr()
149 struct sk_buff *hsr_get_untagged_frame(struct hsr_frame_info *frame, in hsr_get_untagged_frame() argument
152 if (!frame->skb_std) { in hsr_get_untagged_frame()
153 if (frame->skb_hsr) in hsr_get_untagged_frame()
154 frame->skb_std = in hsr_get_untagged_frame()
155 create_stripped_skb_hsr(frame->skb_hsr, frame); in hsr_get_untagged_frame()
160 if (!frame->skb_std) in hsr_get_untagged_frame()
164 return skb_clone(frame->skb_std, GFP_ATOMIC); in hsr_get_untagged_frame()
167 struct sk_buff *prp_get_untagged_frame(struct hsr_frame_info *frame, in prp_get_untagged_frame() argument
170 if (!frame->skb_std) { in prp_get_untagged_frame()
171 if (frame->skb_prp) { in prp_get_untagged_frame()
173 skb_trim(frame->skb_prp, in prp_get_untagged_frame()
174 frame->skb_prp->len - HSR_HLEN); in prp_get_untagged_frame()
175 frame->skb_std = in prp_get_untagged_frame()
176 __pskb_copy(frame->skb_prp, in prp_get_untagged_frame()
177 skb_headroom(frame->skb_prp), in prp_get_untagged_frame()
187 return skb_clone(frame->skb_std, GFP_ATOMIC); in prp_get_untagged_frame()
207 struct hsr_frame_info *frame, in prp_fill_rct() argument
217 if (frame->is_vlan) in prp_fill_rct()
225 if (frame->is_vlan) in prp_fill_rct()
229 trailer->sequence_nr = htons(frame->sequence_nr); in prp_fill_rct()
250 struct hsr_frame_info *frame, in hsr_fill_tag() argument
261 if (frame->is_vlan) in hsr_fill_tag()
268 hsr_ethhdr->hsr_tag.sequence_nr = htons(frame->sequence_nr); in hsr_fill_tag()
280 struct sk_buff *hsr_create_tagged_frame(struct hsr_frame_info *frame, in hsr_create_tagged_frame() argument
287 if (frame->skb_hsr) { in hsr_create_tagged_frame()
289 (struct hsr_ethhdr *)skb_mac_header(frame->skb_hsr); in hsr_create_tagged_frame()
293 return skb_clone(frame->skb_hsr, GFP_ATOMIC); in hsr_create_tagged_frame()
295 return skb_clone(frame->skb_std, GFP_ATOMIC); in hsr_create_tagged_frame()
299 skb = __pskb_copy(frame->skb_std, in hsr_create_tagged_frame()
300 skb_headroom(frame->skb_std) + HSR_HLEN, GFP_ATOMIC); in hsr_create_tagged_frame()
309 if (frame->is_vlan) in hsr_create_tagged_frame()
320 return hsr_fill_tag(skb, frame, port, port->hsr->prot_version); in hsr_create_tagged_frame()
323 struct sk_buff *prp_create_tagged_frame(struct hsr_frame_info *frame, in prp_create_tagged_frame() argument
328 if (frame->skb_prp) { in prp_create_tagged_frame()
329 struct prp_rct *trailer = skb_get_PRP_rct(frame->skb_prp); in prp_create_tagged_frame()
337 return skb_clone(frame->skb_prp, GFP_ATOMIC); in prp_create_tagged_frame()
339 return skb_clone(frame->skb_std, GFP_ATOMIC); in prp_create_tagged_frame()
342 skb = skb_copy_expand(frame->skb_std, 0, in prp_create_tagged_frame()
343 skb_tailroom(frame->skb_std) + HSR_HLEN, in prp_create_tagged_frame()
345 prp_fill_rct(skb, frame, port); in prp_create_tagged_frame()
372 struct hsr_frame_info *frame) in hsr_xmit() argument
374 if (frame->port_rcv->type == HSR_PT_MASTER) { in hsr_xmit()
375 hsr_addr_subst_dest(frame->node_src, skb, port); in hsr_xmit()
385 bool prp_drop_frame(struct hsr_frame_info *frame, struct hsr_port *port) in prp_drop_frame() argument
387 return ((frame->port_rcv->type == HSR_PT_SLAVE_A && in prp_drop_frame()
389 (frame->port_rcv->type == HSR_PT_SLAVE_B && in prp_drop_frame()
393 bool hsr_drop_frame(struct hsr_frame_info *frame, struct hsr_port *port) in hsr_drop_frame() argument
396 return prp_drop_frame(frame, port); in hsr_drop_frame()
413 static void hsr_forward_do(struct hsr_frame_info *frame) in hsr_forward_do() argument
419 hsr_for_each_port(frame->port_rcv->hsr, port) { in hsr_forward_do()
422 if (port == frame->port_rcv) in hsr_forward_do()
426 if (port->type == HSR_PT_MASTER && !frame->is_local_dest) in hsr_forward_do()
430 if (port->type != HSR_PT_MASTER && frame->is_local_exclusive) in hsr_forward_do()
442 if (!frame->is_from_san && in hsr_forward_do()
443 hsr_register_frame_out(port, frame->node_src, in hsr_forward_do()
444 frame->sequence_nr)) in hsr_forward_do()
447 if (frame->is_supervision && port->type == HSR_PT_MASTER) { in hsr_forward_do()
448 hsr_handle_sup_frame(frame); in hsr_forward_do()
456 hsr->proto_ops->drop_frame(frame, port)) in hsr_forward_do()
460 skb = hsr->proto_ops->create_tagged_frame(frame, port); in hsr_forward_do()
462 skb = hsr->proto_ops->get_untagged_frame(frame, port); in hsr_forward_do()
465 frame->port_rcv->dev->stats.rx_dropped++; in hsr_forward_do()
471 hsr_deliver_master(skb, port->dev, frame->node_src); in hsr_forward_do()
473 if (!hsr_xmit(skb, port, frame)) in hsr_forward_do()
480 struct hsr_frame_info *frame) in check_local_dest() argument
483 frame->is_local_exclusive = true; in check_local_dest()
486 frame->is_local_exclusive = false; in check_local_dest()
492 frame->is_local_dest = true; in check_local_dest()
494 frame->is_local_dest = false; in check_local_dest()
499 struct hsr_frame_info *frame) in handle_std_frame() argument
501 struct hsr_port *port = frame->port_rcv; in handle_std_frame()
504 frame->skb_hsr = NULL; in handle_std_frame()
505 frame->skb_prp = NULL; in handle_std_frame()
506 frame->skb_std = skb; in handle_std_frame()
509 frame->is_from_san = true; in handle_std_frame()
513 frame->sequence_nr = hsr->sequence_nr; in handle_std_frame()
519 struct hsr_frame_info *frame) in hsr_fill_frame_info() argument
521 struct hsr_port *port = frame->port_rcv; in hsr_fill_frame_info()
532 frame->skb_std = NULL; in hsr_fill_frame_info()
533 frame->skb_prp = NULL; in hsr_fill_frame_info()
534 frame->skb_hsr = skb; in hsr_fill_frame_info()
535 frame->sequence_nr = hsr_get_skb_sequence_nr(skb); in hsr_fill_frame_info()
540 handle_std_frame(skb, frame); in hsr_fill_frame_info()
546 struct hsr_frame_info *frame) in prp_fill_frame_info() argument
552 prp_check_lsdu_size(skb, rct, frame->is_supervision)) { in prp_fill_frame_info()
553 frame->skb_hsr = NULL; in prp_fill_frame_info()
554 frame->skb_std = NULL; in prp_fill_frame_info()
555 frame->skb_prp = skb; in prp_fill_frame_info()
556 frame->sequence_nr = prp_get_skb_sequence_nr(rct); in prp_fill_frame_info()
559 handle_std_frame(skb, frame); in prp_fill_frame_info()
564 static int fill_frame_info(struct hsr_frame_info *frame, in fill_frame_info() argument
577 memset(frame, 0, sizeof(*frame)); in fill_frame_info()
578 frame->is_supervision = is_supervision_frame(port->hsr, skb); in fill_frame_info()
579 frame->node_src = hsr_get_node(port, &hsr->node_db, skb, in fill_frame_info()
580 frame->is_supervision, in fill_frame_info()
582 if (!frame->node_src) in fill_frame_info()
586 frame->is_vlan = false; in fill_frame_info()
590 frame->is_vlan = true; in fill_frame_info()
592 if (frame->is_vlan) { in fill_frame_info()
599 frame->is_from_san = false; in fill_frame_info()
600 frame->port_rcv = port; in fill_frame_info()
601 ret = hsr->proto_ops->fill_frame_info(proto, skb, frame); in fill_frame_info()
605 check_local_dest(port->hsr, skb, frame); in fill_frame_info()
613 struct hsr_frame_info frame; in hsr_forward_skb() local
616 if (fill_frame_info(&frame, skb, port) < 0) in hsr_forward_skb()
619 hsr_register_frame_in(frame.node_src, port, frame.sequence_nr); in hsr_forward_skb()
620 hsr_forward_do(&frame); in hsr_forward_skb()
630 kfree_skb(frame.skb_hsr); in hsr_forward_skb()
631 kfree_skb(frame.skb_prp); in hsr_forward_skb()
632 kfree_skb(frame.skb_std); in hsr_forward_skb()