Lines Matching refs:tpriv
251 struct stmmac_test_priv *tpriv = pt->af_packet_priv; in stmmac_test_loopback_validate() local
252 unsigned char *src = tpriv->packet->src; in stmmac_test_loopback_validate()
253 unsigned char *dst = tpriv->packet->dst; in stmmac_test_loopback_validate()
274 if (tpriv->packet->sarc) { in stmmac_test_loopback_validate()
283 if (tpriv->double_vlan) in stmmac_test_loopback_validate()
286 if (tpriv->packet->tcp) { in stmmac_test_loopback_validate()
291 if (thdr->dest != htons(tpriv->packet->dport)) in stmmac_test_loopback_validate()
300 if (uhdr->dest != htons(tpriv->packet->dport)) in stmmac_test_loopback_validate()
308 if (tpriv->packet->exp_hash && !skb->hash) in stmmac_test_loopback_validate()
310 if (tpriv->packet->id != shdr->id) in stmmac_test_loopback_validate()
313 tpriv->ok = true; in stmmac_test_loopback_validate()
314 complete(&tpriv->comp); in stmmac_test_loopback_validate()
323 struct stmmac_test_priv *tpriv; in __stmmac_test_loopback() local
327 tpriv = kzalloc(sizeof(*tpriv), GFP_KERNEL); in __stmmac_test_loopback()
328 if (!tpriv) in __stmmac_test_loopback()
331 tpriv->ok = false; in __stmmac_test_loopback()
332 init_completion(&tpriv->comp); in __stmmac_test_loopback()
334 tpriv->pt.type = htons(ETH_P_IP); in __stmmac_test_loopback()
335 tpriv->pt.func = stmmac_test_loopback_validate; in __stmmac_test_loopback()
336 tpriv->pt.dev = priv->dev; in __stmmac_test_loopback()
337 tpriv->pt.af_packet_priv = tpriv; in __stmmac_test_loopback()
338 tpriv->packet = attr; in __stmmac_test_loopback()
341 dev_add_pack(&tpriv->pt); in __stmmac_test_loopback()
359 wait_for_completion_timeout(&tpriv->comp, attr->timeout); in __stmmac_test_loopback()
360 ret = tpriv->ok ? 0 : -ETIMEDOUT; in __stmmac_test_loopback()
364 dev_remove_pack(&tpriv->pt); in __stmmac_test_loopback()
365 kfree(tpriv); in __stmmac_test_loopback()
719 struct stmmac_test_priv *tpriv = pt->af_packet_priv; in stmmac_test_flowctrl_validate() local
728 tpriv->ok = true; in stmmac_test_flowctrl_validate()
729 complete(&tpriv->comp); in stmmac_test_flowctrl_validate()
740 struct stmmac_test_priv *tpriv; in stmmac_test_flowctrl() local
747 tpriv = kzalloc(sizeof(*tpriv), GFP_KERNEL); in stmmac_test_flowctrl()
748 if (!tpriv) in stmmac_test_flowctrl()
751 tpriv->ok = false; in stmmac_test_flowctrl()
752 init_completion(&tpriv->comp); in stmmac_test_flowctrl()
753 tpriv->pt.type = htons(ETH_P_PAUSE); in stmmac_test_flowctrl()
754 tpriv->pt.func = stmmac_test_flowctrl_validate; in stmmac_test_flowctrl()
755 tpriv->pt.dev = priv->dev; in stmmac_test_flowctrl()
756 tpriv->pt.af_packet_priv = tpriv; in stmmac_test_flowctrl()
757 dev_add_pack(&tpriv->pt); in stmmac_test_flowctrl()
787 if (tpriv->ok) in stmmac_test_flowctrl()
809 wait_for_completion_timeout(&tpriv->comp, STMMAC_LB_TIMEOUT); in stmmac_test_flowctrl()
810 ret = tpriv->ok ? 0 : -ETIMEDOUT; in stmmac_test_flowctrl()
815 dev_remove_pack(&tpriv->pt); in stmmac_test_flowctrl()
816 kfree(tpriv); in stmmac_test_flowctrl()
840 struct stmmac_test_priv *tpriv = pt->af_packet_priv; in stmmac_test_vlan_validate() local
847 proto = tpriv->double_vlan ? ETH_P_8021AD : ETH_P_8021Q; in stmmac_test_vlan_validate()
857 if (tpriv->vlan_id) { in stmmac_test_vlan_validate()
860 if (skb->vlan_tci != tpriv->vlan_id) { in stmmac_test_vlan_validate()
862 tpriv->ok = false; in stmmac_test_vlan_validate()
863 complete(&tpriv->comp); in stmmac_test_vlan_validate()
869 if (!ether_addr_equal_unaligned(ehdr->h_dest, tpriv->packet->dst)) in stmmac_test_vlan_validate()
873 if (tpriv->double_vlan) in stmmac_test_vlan_validate()
879 if (uhdr->dest != htons(tpriv->packet->dport)) in stmmac_test_vlan_validate()
886 tpriv->ok = true; in stmmac_test_vlan_validate()
887 complete(&tpriv->comp); in stmmac_test_vlan_validate()
897 struct stmmac_test_priv *tpriv; in __stmmac_test_vlanfilt() local
901 tpriv = kzalloc(sizeof(*tpriv), GFP_KERNEL); in __stmmac_test_vlanfilt()
902 if (!tpriv) in __stmmac_test_vlanfilt()
905 tpriv->ok = false; in __stmmac_test_vlanfilt()
906 init_completion(&tpriv->comp); in __stmmac_test_vlanfilt()
908 tpriv->pt.type = htons(ETH_P_IP); in __stmmac_test_vlanfilt()
909 tpriv->pt.func = stmmac_test_vlan_validate; in __stmmac_test_vlanfilt()
910 tpriv->pt.dev = priv->dev; in __stmmac_test_vlanfilt()
911 tpriv->pt.af_packet_priv = tpriv; in __stmmac_test_vlanfilt()
912 tpriv->packet = &attr; in __stmmac_test_vlanfilt()
919 tpriv->vlan_id = 0x123; in __stmmac_test_vlanfilt()
920 dev_add_pack(&tpriv->pt); in __stmmac_test_vlanfilt()
922 ret = vlan_vid_add(priv->dev, htons(ETH_P_8021Q), tpriv->vlan_id); in __stmmac_test_vlanfilt()
928 attr.vlan_id_out = tpriv->vlan_id + i; in __stmmac_test_vlanfilt()
943 wait_for_completion_timeout(&tpriv->comp, STMMAC_LB_TIMEOUT); in __stmmac_test_vlanfilt()
944 ret = tpriv->ok ? 0 : -ETIMEDOUT; in __stmmac_test_vlanfilt()
954 tpriv->ok = false; in __stmmac_test_vlanfilt()
958 vlan_vid_del(priv->dev, htons(ETH_P_8021Q), tpriv->vlan_id); in __stmmac_test_vlanfilt()
960 dev_remove_pack(&tpriv->pt); in __stmmac_test_vlanfilt()
961 kfree(tpriv); in __stmmac_test_vlanfilt()
990 struct stmmac_test_priv *tpriv; in __stmmac_test_dvlanfilt() local
994 tpriv = kzalloc(sizeof(*tpriv), GFP_KERNEL); in __stmmac_test_dvlanfilt()
995 if (!tpriv) in __stmmac_test_dvlanfilt()
998 tpriv->ok = false; in __stmmac_test_dvlanfilt()
999 tpriv->double_vlan = true; in __stmmac_test_dvlanfilt()
1000 init_completion(&tpriv->comp); in __stmmac_test_dvlanfilt()
1002 tpriv->pt.type = htons(ETH_P_8021Q); in __stmmac_test_dvlanfilt()
1003 tpriv->pt.func = stmmac_test_vlan_validate; in __stmmac_test_dvlanfilt()
1004 tpriv->pt.dev = priv->dev; in __stmmac_test_dvlanfilt()
1005 tpriv->pt.af_packet_priv = tpriv; in __stmmac_test_dvlanfilt()
1006 tpriv->packet = &attr; in __stmmac_test_dvlanfilt()
1013 tpriv->vlan_id = 0x123; in __stmmac_test_dvlanfilt()
1014 dev_add_pack(&tpriv->pt); in __stmmac_test_dvlanfilt()
1016 ret = vlan_vid_add(priv->dev, htons(ETH_P_8021AD), tpriv->vlan_id); in __stmmac_test_dvlanfilt()
1022 attr.vlan_id_out = tpriv->vlan_id + i; in __stmmac_test_dvlanfilt()
1037 wait_for_completion_timeout(&tpriv->comp, STMMAC_LB_TIMEOUT); in __stmmac_test_dvlanfilt()
1038 ret = tpriv->ok ? 0 : -ETIMEDOUT; in __stmmac_test_dvlanfilt()
1048 tpriv->ok = false; in __stmmac_test_dvlanfilt()
1052 vlan_vid_del(priv->dev, htons(ETH_P_8021AD), tpriv->vlan_id); in __stmmac_test_dvlanfilt()
1054 dev_remove_pack(&tpriv->pt); in __stmmac_test_dvlanfilt()
1055 kfree(tpriv); in __stmmac_test_dvlanfilt()
1261 struct stmmac_test_priv *tpriv; in stmmac_test_vlanoff_common() local
1269 tpriv = kzalloc(sizeof(*tpriv), GFP_KERNEL); in stmmac_test_vlanoff_common()
1270 if (!tpriv) in stmmac_test_vlanoff_common()
1275 tpriv->ok = false; in stmmac_test_vlanoff_common()
1276 tpriv->double_vlan = svlan; in stmmac_test_vlanoff_common()
1277 init_completion(&tpriv->comp); in stmmac_test_vlanoff_common()
1279 tpriv->pt.type = svlan ? htons(ETH_P_8021Q) : htons(ETH_P_IP); in stmmac_test_vlanoff_common()
1280 tpriv->pt.func = stmmac_test_vlan_validate; in stmmac_test_vlanoff_common()
1281 tpriv->pt.dev = priv->dev; in stmmac_test_vlanoff_common()
1282 tpriv->pt.af_packet_priv = tpriv; in stmmac_test_vlanoff_common()
1283 tpriv->packet = &attr; in stmmac_test_vlanoff_common()
1284 tpriv->vlan_id = 0x123; in stmmac_test_vlanoff_common()
1285 dev_add_pack(&tpriv->pt); in stmmac_test_vlanoff_common()
1287 ret = vlan_vid_add(priv->dev, htons(proto), tpriv->vlan_id); in stmmac_test_vlanoff_common()
1299 __vlan_hwaccel_put_tag(skb, htons(proto), tpriv->vlan_id); in stmmac_test_vlanoff_common()
1306 wait_for_completion_timeout(&tpriv->comp, STMMAC_LB_TIMEOUT); in stmmac_test_vlanoff_common()
1307 ret = tpriv->ok ? 0 : -ETIMEDOUT; in stmmac_test_vlanoff_common()
1310 vlan_vid_del(priv->dev, htons(proto), tpriv->vlan_id); in stmmac_test_vlanoff_common()
1312 dev_remove_pack(&tpriv->pt); in stmmac_test_vlanoff_common()
1313 kfree(tpriv); in stmmac_test_vlanoff_common()
1598 struct stmmac_test_priv *tpriv = pt->af_packet_priv; in stmmac_test_arp_validate() local
1603 if (!ether_addr_equal_unaligned(ehdr->h_dest, tpriv->packet->src)) in stmmac_test_arp_validate()
1610 tpriv->ok = true; in stmmac_test_arp_validate()
1611 complete(&tpriv->comp); in stmmac_test_arp_validate()
1622 struct stmmac_test_priv *tpriv; in stmmac_test_arpoffload() local
1631 tpriv = kzalloc(sizeof(*tpriv), GFP_KERNEL); in stmmac_test_arpoffload()
1632 if (!tpriv) in stmmac_test_arpoffload()
1635 tpriv->ok = false; in stmmac_test_arpoffload()
1636 init_completion(&tpriv->comp); in stmmac_test_arpoffload()
1638 tpriv->pt.type = htons(ETH_P_ARP); in stmmac_test_arpoffload()
1639 tpriv->pt.func = stmmac_test_arp_validate; in stmmac_test_arpoffload()
1640 tpriv->pt.dev = priv->dev; in stmmac_test_arpoffload()
1641 tpriv->pt.af_packet_priv = tpriv; in stmmac_test_arpoffload()
1642 tpriv->packet = &attr; in stmmac_test_arpoffload()
1643 dev_add_pack(&tpriv->pt); in stmmac_test_arpoffload()
1672 wait_for_completion_timeout(&tpriv->comp, STMMAC_LB_TIMEOUT); in stmmac_test_arpoffload()
1673 ret = tpriv->ok ? 0 : -ETIMEDOUT; in stmmac_test_arpoffload()
1679 dev_remove_pack(&tpriv->pt); in stmmac_test_arpoffload()
1680 kfree(tpriv); in stmmac_test_arpoffload()