Lines Matching refs:sgi
2038 struct felix_stream_gate *sgi) in vsc9959_psfp_parse_gate() argument
2040 sgi->index = entry->hw_index; in vsc9959_psfp_parse_gate()
2041 sgi->ipv_valid = (entry->gate.prio < 0) ? 0 : 1; in vsc9959_psfp_parse_gate()
2042 sgi->init_ipv = (sgi->ipv_valid) ? entry->gate.prio : 0; in vsc9959_psfp_parse_gate()
2043 sgi->basetime = entry->gate.basetime; in vsc9959_psfp_parse_gate()
2044 sgi->cycletime = entry->gate.cycletime; in vsc9959_psfp_parse_gate()
2045 sgi->num_entries = entry->gate.num_entries; in vsc9959_psfp_parse_gate()
2046 sgi->enable = 1; in vsc9959_psfp_parse_gate()
2048 memcpy(sgi->entries, entry->gate.entries, in vsc9959_psfp_parse_gate()
2058 struct felix_stream_gate *sgi) in vsc9959_psfp_sgi_set() argument
2066 if (sgi->index > VSC9959_PSFP_GATE_ID_MAX) in vsc9959_psfp_sgi_set()
2069 ocelot_write(ocelot, ANA_SG_ACCESS_CTRL_SGID(sgi->index), in vsc9959_psfp_sgi_set()
2072 if (!sgi->enable) { in vsc9959_psfp_sgi_set()
2081 if (sgi->cycletime < VSC9959_PSFP_GATE_CYCLETIME_MIN || in vsc9959_psfp_sgi_set()
2082 sgi->cycletime > NSEC_PER_SEC) in vsc9959_psfp_sgi_set()
2085 if (sgi->num_entries > VSC9959_PSFP_GATE_LIST_NUM) in vsc9959_psfp_sgi_set()
2088 vsc9959_new_base_time(ocelot, sgi->basetime, sgi->cycletime, &base_ts); in vsc9959_psfp_sgi_set()
2095 (sgi->ipv_valid ? ANA_SG_CONFIG_REG_3_IPV_VALID : 0) | in vsc9959_psfp_sgi_set()
2096 ANA_SG_CONFIG_REG_3_INIT_IPV(sgi->init_ipv) | in vsc9959_psfp_sgi_set()
2098 ANA_SG_CONFIG_REG_3_LIST_LENGTH(sgi->num_entries) | in vsc9959_psfp_sgi_set()
2103 ocelot_write(ocelot, sgi->cycletime, ANA_SG_CONFIG_REG_4); in vsc9959_psfp_sgi_set()
2105 e = sgi->entries; in vsc9959_psfp_sgi_set()
2106 for (i = 0; i < sgi->num_entries; i++) { in vsc9959_psfp_sgi_set()
2128 struct felix_stream_gate *sgi) in vsc9959_psfp_sgi_table_add() argument
2137 if (tmp->index == sgi->index) { in vsc9959_psfp_sgi_table_add()
2146 ret = vsc9959_psfp_sgi_set(ocelot, sgi); in vsc9959_psfp_sgi_table_add()
2152 tmp->index = sgi->index; in vsc9959_psfp_sgi_table_add()
2163 struct felix_stream_gate sgi = {0}; in vsc9959_psfp_sgi_table_del() local
2173 sgi.index = index; in vsc9959_psfp_sgi_table_del()
2174 sgi.enable = 0; in vsc9959_psfp_sgi_table_del()
2175 vsc9959_psfp_sgi_set(ocelot, &sgi); in vsc9959_psfp_sgi_table_del()
2192 struct felix_stream_gate *sgi; in vsc9959_psfp_filter_add() local
2212 size = struct_size(sgi, entries, a->gate.num_entries); in vsc9959_psfp_filter_add()
2213 sgi = kzalloc(size, GFP_KERNEL); in vsc9959_psfp_filter_add()
2214 if (!sgi) { in vsc9959_psfp_filter_add()
2218 vsc9959_psfp_parse_gate(a, sgi); in vsc9959_psfp_filter_add()
2219 ret = vsc9959_psfp_sgi_table_add(ocelot, sgi); in vsc9959_psfp_filter_add()
2221 kfree(sgi); in vsc9959_psfp_filter_add()
2225 sfi.sgid = sgi->index; in vsc9959_psfp_filter_add()
2226 kfree(sgi); in vsc9959_psfp_filter_add()