Lines Matching refs:sgi
740 struct enetc_psfp_gate *sgi, in enetc_streamgate_hw_set() argument
754 cbd.index = cpu_to_le16(sgi->index); in enetc_streamgate_hw_set()
763 if (!sgi->num_entries) in enetc_streamgate_hw_set()
766 if (sgi->num_entries > priv->psfp_cap.max_psfp_gatelist || in enetc_streamgate_hw_set()
767 !sgi->cycletime) in enetc_streamgate_hw_set()
776 sgi_config->oipv = (sgi->init_ipv < 0) ? in enetc_streamgate_hw_set()
777 0x0 : ((sgi->init_ipv & 0x7) | 0x8); in enetc_streamgate_hw_set()
788 cbd.index = cpu_to_le16(sgi->index); in enetc_streamgate_hw_set()
795 sgcl_config->acl_len = (sgi->num_entries - 1) & 0x3; in enetc_streamgate_hw_set()
797 data_size = struct_size(sgcl_data, sgcl, sgi->num_entries); in enetc_streamgate_hw_set()
807 sgcl_data->ct = sgi->cycletime; in enetc_streamgate_hw_set()
808 sgcl_data->cte = sgi->cycletimext; in enetc_streamgate_hw_set()
810 if (sgi->init_ipv >= 0) in enetc_streamgate_hw_set()
811 sgcl_config->aipv = (sgi->init_ipv & 0x7) | 0x8; in enetc_streamgate_hw_set()
813 for (i = 0; i < sgi->num_entries; i++) { in enetc_streamgate_hw_set()
814 struct action_gate_entry *from = &sgi->entries[i]; in enetc_streamgate_hw_set()
836 if (sgi->basetime < now) { in enetc_streamgate_hw_set()
839 err = get_start_ns(now, sgi->cycletime, &start); in enetc_streamgate_hw_set()
847 hi = upper_32_bits(sgi->basetime); in enetc_streamgate_hw_set()
848 lo = lower_32_bits(sgi->basetime); in enetc_streamgate_hw_set()
991 struct enetc_psfp_gate *sgi; in stream_gate_unref() local
994 sgi = enetc_get_gate_by_index(index); in stream_gate_unref()
995 WARN_ON(!sgi); in stream_gate_unref()
996 z = refcount_dec_and_test(&sgi->refcount); in stream_gate_unref()
998 enetc_streamgate_hw_set(priv, sgi, false); in stream_gate_unref()
999 hlist_del(&sgi->node); in stream_gate_unref()
1000 kfree(sgi); in stream_gate_unref()
1035 struct enetc_psfp_gate *sgi, in enetc_psfp_hw_set() argument
1050 err = enetc_streamgate_hw_set(priv, sgi, true); in enetc_psfp_hw_set()
1063 enetc_streamgate_hw_set(priv, sgi, false); in enetc_psfp_hw_set()
1134 struct enetc_psfp_gate *sgi, *old_sgi; in enetc_psfp_parse_clsflower() local
1245 entries_size = struct_size(sgi, entries, entryg->gate.num_entries); in enetc_psfp_parse_clsflower()
1246 sgi = kzalloc(entries_size, GFP_KERNEL); in enetc_psfp_parse_clsflower()
1247 if (!sgi) { in enetc_psfp_parse_clsflower()
1252 refcount_set(&sgi->refcount, 1); in enetc_psfp_parse_clsflower()
1253 sgi->index = entryg->hw_index; in enetc_psfp_parse_clsflower()
1254 sgi->init_ipv = entryg->gate.prio; in enetc_psfp_parse_clsflower()
1255 sgi->basetime = entryg->gate.basetime; in enetc_psfp_parse_clsflower()
1256 sgi->cycletime = entryg->gate.cycletime; in enetc_psfp_parse_clsflower()
1257 sgi->num_entries = entryg->gate.num_entries; in enetc_psfp_parse_clsflower()
1259 e = sgi->entries; in enetc_psfp_parse_clsflower()
1267 filter->sgi_index = sgi->index; in enetc_psfp_parse_clsflower()
1276 sfi->gate_id = sgi->index; in enetc_psfp_parse_clsflower()
1334 sfi_overwrite ? NULL : sfi, sgi, fmi); in enetc_psfp_parse_clsflower()
1354 refcount_set(&sgi->refcount, in enetc_psfp_parse_clsflower()
1360 hlist_add_head(&sgi->node, &epsfp.psfp_gate_list); in enetc_psfp_parse_clsflower()
1386 kfree(sgi); in enetc_psfp_parse_clsflower()
1544 struct enetc_psfp_gate *sgi; in clean_sgi_list() local
1547 hlist_for_each_entry_safe(sgi, tmp, &epsfp.psfp_gate_list, node) { in clean_sgi_list()
1548 hlist_del(&sgi->node); in clean_sgi_list()
1549 kfree(sgi); in clean_sgi_list()