• Home
  • Raw
  • Download

Lines Matching refs:frame

79 					       struct hsr_frame_info *frame)  in create_stripped_skb_hsr()  argument
97 if (frame->is_vlan) in create_stripped_skb_hsr()
107 struct sk_buff *hsr_get_untagged_frame(struct hsr_frame_info *frame, in hsr_get_untagged_frame() argument
110 if (!frame->skb_std) { in hsr_get_untagged_frame()
111 if (frame->skb_hsr) in hsr_get_untagged_frame()
112 frame->skb_std = in hsr_get_untagged_frame()
113 create_stripped_skb_hsr(frame->skb_hsr, frame); in hsr_get_untagged_frame()
118 if (!frame->skb_std) in hsr_get_untagged_frame()
122 return skb_clone(frame->skb_std, GFP_ATOMIC); in hsr_get_untagged_frame()
125 struct sk_buff *prp_get_untagged_frame(struct hsr_frame_info *frame, in prp_get_untagged_frame() argument
128 if (!frame->skb_std) { in prp_get_untagged_frame()
129 if (frame->skb_prp) { in prp_get_untagged_frame()
131 skb_trim(frame->skb_prp, in prp_get_untagged_frame()
132 frame->skb_prp->len - HSR_HLEN); in prp_get_untagged_frame()
133 frame->skb_std = in prp_get_untagged_frame()
134 __pskb_copy(frame->skb_prp, in prp_get_untagged_frame()
135 skb_headroom(frame->skb_prp), in prp_get_untagged_frame()
145 return skb_clone(frame->skb_std, GFP_ATOMIC); in prp_get_untagged_frame()
165 struct hsr_frame_info *frame, in prp_fill_rct() argument
175 if (frame->is_vlan) in prp_fill_rct()
183 if (frame->is_vlan) in prp_fill_rct()
187 trailer->sequence_nr = htons(frame->sequence_nr); in prp_fill_rct()
208 struct hsr_frame_info *frame, in hsr_fill_tag() argument
219 if (frame->is_vlan) in hsr_fill_tag()
226 hsr_ethhdr->hsr_tag.sequence_nr = htons(frame->sequence_nr); in hsr_fill_tag()
238 struct sk_buff *hsr_create_tagged_frame(struct hsr_frame_info *frame, in hsr_create_tagged_frame() argument
245 if (frame->skb_hsr) { in hsr_create_tagged_frame()
247 (struct hsr_ethhdr *)skb_mac_header(frame->skb_hsr); in hsr_create_tagged_frame()
251 return skb_clone(frame->skb_hsr, GFP_ATOMIC); in hsr_create_tagged_frame()
253 return skb_clone(frame->skb_std, GFP_ATOMIC); in hsr_create_tagged_frame()
257 skb = __pskb_copy(frame->skb_std, in hsr_create_tagged_frame()
258 skb_headroom(frame->skb_std) + HSR_HLEN, GFP_ATOMIC); in hsr_create_tagged_frame()
267 if (frame->is_vlan) in hsr_create_tagged_frame()
278 return hsr_fill_tag(skb, frame, port, port->hsr->prot_version); in hsr_create_tagged_frame()
281 struct sk_buff *prp_create_tagged_frame(struct hsr_frame_info *frame, in prp_create_tagged_frame() argument
286 if (frame->skb_prp) { in prp_create_tagged_frame()
287 struct prp_rct *trailer = skb_get_PRP_rct(frame->skb_prp); in prp_create_tagged_frame()
295 return skb_clone(frame->skb_prp, GFP_ATOMIC); in prp_create_tagged_frame()
297 return skb_clone(frame->skb_std, GFP_ATOMIC); in prp_create_tagged_frame()
300 skb = skb_copy_expand(frame->skb_std, 0, in prp_create_tagged_frame()
301 skb_tailroom(frame->skb_std) + HSR_HLEN, in prp_create_tagged_frame()
303 return prp_fill_rct(skb, frame, port); in prp_create_tagged_frame()
328 struct hsr_frame_info *frame) in hsr_xmit() argument
330 if (frame->port_rcv->type == HSR_PT_MASTER) { in hsr_xmit()
331 hsr_addr_subst_dest(frame->node_src, skb, port); in hsr_xmit()
341 bool prp_drop_frame(struct hsr_frame_info *frame, struct hsr_port *port) in prp_drop_frame() argument
343 return ((frame->port_rcv->type == HSR_PT_SLAVE_A && in prp_drop_frame()
345 (frame->port_rcv->type == HSR_PT_SLAVE_B && in prp_drop_frame()
349 bool hsr_drop_frame(struct hsr_frame_info *frame, struct hsr_port *port) in hsr_drop_frame() argument
352 return prp_drop_frame(frame, port); in hsr_drop_frame()
369 static void hsr_forward_do(struct hsr_frame_info *frame) in hsr_forward_do() argument
375 hsr_for_each_port(frame->port_rcv->hsr, port) { in hsr_forward_do()
378 if (port == frame->port_rcv) in hsr_forward_do()
382 if (port->type == HSR_PT_MASTER && !frame->is_local_dest) in hsr_forward_do()
386 if (port->type != HSR_PT_MASTER && frame->is_local_exclusive) in hsr_forward_do()
398 if (!frame->is_from_san && in hsr_forward_do()
399 hsr_register_frame_out(port, frame->node_src, in hsr_forward_do()
400 frame->sequence_nr)) in hsr_forward_do()
403 if (frame->is_supervision && port->type == HSR_PT_MASTER) { in hsr_forward_do()
404 hsr_handle_sup_frame(frame); in hsr_forward_do()
412 hsr->proto_ops->drop_frame(frame, port)) in hsr_forward_do()
416 skb = hsr->proto_ops->create_tagged_frame(frame, port); in hsr_forward_do()
418 skb = hsr->proto_ops->get_untagged_frame(frame, port); in hsr_forward_do()
421 frame->port_rcv->dev->stats.rx_dropped++; in hsr_forward_do()
427 hsr_deliver_master(skb, port->dev, frame->node_src); in hsr_forward_do()
429 if (!hsr_xmit(skb, port, frame)) in hsr_forward_do()
436 struct hsr_frame_info *frame) in check_local_dest() argument
439 frame->is_local_exclusive = true; in check_local_dest()
442 frame->is_local_exclusive = false; in check_local_dest()
448 frame->is_local_dest = true; in check_local_dest()
450 frame->is_local_dest = false; in check_local_dest()
455 struct hsr_frame_info *frame) in handle_std_frame() argument
457 struct hsr_port *port = frame->port_rcv; in handle_std_frame()
460 frame->skb_hsr = NULL; in handle_std_frame()
461 frame->skb_prp = NULL; in handle_std_frame()
462 frame->skb_std = skb; in handle_std_frame()
465 frame->is_from_san = true; in handle_std_frame()
469 frame->sequence_nr = hsr->sequence_nr; in handle_std_frame()
475 struct hsr_frame_info *frame) in hsr_fill_frame_info() argument
477 struct hsr_port *port = frame->port_rcv; in hsr_fill_frame_info()
488 frame->skb_std = NULL; in hsr_fill_frame_info()
489 frame->skb_prp = NULL; in hsr_fill_frame_info()
490 frame->skb_hsr = skb; in hsr_fill_frame_info()
491 frame->sequence_nr = hsr_get_skb_sequence_nr(skb); in hsr_fill_frame_info()
496 handle_std_frame(skb, frame); in hsr_fill_frame_info()
502 struct hsr_frame_info *frame) in prp_fill_frame_info() argument
508 prp_check_lsdu_size(skb, rct, frame->is_supervision)) { in prp_fill_frame_info()
509 frame->skb_hsr = NULL; in prp_fill_frame_info()
510 frame->skb_std = NULL; in prp_fill_frame_info()
511 frame->skb_prp = skb; in prp_fill_frame_info()
512 frame->sequence_nr = prp_get_skb_sequence_nr(rct); in prp_fill_frame_info()
515 handle_std_frame(skb, frame); in prp_fill_frame_info()
520 static int fill_frame_info(struct hsr_frame_info *frame, in fill_frame_info() argument
533 memset(frame, 0, sizeof(*frame)); in fill_frame_info()
534 frame->is_supervision = is_supervision_frame(port->hsr, skb); in fill_frame_info()
535 frame->node_src = hsr_get_node(port, &hsr->node_db, skb, in fill_frame_info()
536 frame->is_supervision, in fill_frame_info()
538 if (!frame->node_src) in fill_frame_info()
542 frame->is_vlan = false; in fill_frame_info()
546 frame->is_vlan = true; in fill_frame_info()
548 if (frame->is_vlan) { in fill_frame_info()
556 frame->is_from_san = false; in fill_frame_info()
557 frame->port_rcv = port; in fill_frame_info()
558 ret = hsr->proto_ops->fill_frame_info(proto, skb, frame); in fill_frame_info()
562 check_local_dest(port->hsr, skb, frame); in fill_frame_info()
570 struct hsr_frame_info frame; in hsr_forward_skb() local
573 if (fill_frame_info(&frame, skb, port) < 0) in hsr_forward_skb()
576 hsr_register_frame_in(frame.node_src, port, frame.sequence_nr); in hsr_forward_skb()
577 hsr_forward_do(&frame); in hsr_forward_skb()
587 kfree_skb(frame.skb_hsr); in hsr_forward_skb()
588 kfree_skb(frame.skb_prp); in hsr_forward_skb()
589 kfree_skb(frame.skb_std); in hsr_forward_skb()