Lines Matching full:sgi
2091 struct felix_stream_gate *sgi) in vsc9959_psfp_parse_gate() argument
2093 sgi->index = entry->hw_index; in vsc9959_psfp_parse_gate()
2094 sgi->ipv_valid = (entry->gate.prio < 0) ? 0 : 1; in vsc9959_psfp_parse_gate()
2095 sgi->init_ipv = (sgi->ipv_valid) ? entry->gate.prio : 0; in vsc9959_psfp_parse_gate()
2096 sgi->basetime = entry->gate.basetime; in vsc9959_psfp_parse_gate()
2097 sgi->cycletime = entry->gate.cycletime; in vsc9959_psfp_parse_gate()
2098 sgi->num_entries = entry->gate.num_entries; in vsc9959_psfp_parse_gate()
2099 sgi->enable = 1; in vsc9959_psfp_parse_gate()
2101 memcpy(sgi->entries, entry->gate.entries, in vsc9959_psfp_parse_gate()
2111 struct felix_stream_gate *sgi) in vsc9959_psfp_sgi_set() argument
2119 if (sgi->index > VSC9959_PSFP_GATE_ID_MAX) in vsc9959_psfp_sgi_set()
2122 ocelot_write(ocelot, ANA_SG_ACCESS_CTRL_SGID(sgi->index), in vsc9959_psfp_sgi_set()
2125 if (!sgi->enable) { in vsc9959_psfp_sgi_set()
2134 if (sgi->cycletime < VSC9959_PSFP_GATE_CYCLETIME_MIN || in vsc9959_psfp_sgi_set()
2135 sgi->cycletime > NSEC_PER_SEC) in vsc9959_psfp_sgi_set()
2138 if (sgi->num_entries > VSC9959_PSFP_GATE_LIST_NUM) in vsc9959_psfp_sgi_set()
2141 vsc9959_new_base_time(ocelot, sgi->basetime, sgi->cycletime, &base_ts); in vsc9959_psfp_sgi_set()
2148 (sgi->ipv_valid ? ANA_SG_CONFIG_REG_3_IPV_VALID : 0) | in vsc9959_psfp_sgi_set()
2149 ANA_SG_CONFIG_REG_3_INIT_IPV(sgi->init_ipv) | in vsc9959_psfp_sgi_set()
2151 ANA_SG_CONFIG_REG_3_LIST_LENGTH(sgi->num_entries) | in vsc9959_psfp_sgi_set()
2156 ocelot_write(ocelot, sgi->cycletime, ANA_SG_CONFIG_REG_4); in vsc9959_psfp_sgi_set()
2158 e = sgi->entries; in vsc9959_psfp_sgi_set()
2159 for (i = 0; i < sgi->num_entries; i++) { in vsc9959_psfp_sgi_set()
2181 struct felix_stream_gate *sgi) in vsc9959_psfp_sgi_table_add() argument
2190 if (tmp->index == sgi->index) { in vsc9959_psfp_sgi_table_add()
2199 ret = vsc9959_psfp_sgi_set(ocelot, sgi); in vsc9959_psfp_sgi_table_add()
2205 tmp->index = sgi->index; in vsc9959_psfp_sgi_table_add()
2216 struct felix_stream_gate sgi = {0}; in vsc9959_psfp_sgi_table_del() local
2226 sgi.index = index; in vsc9959_psfp_sgi_table_del()
2227 sgi.enable = 0; in vsc9959_psfp_sgi_table_del()
2228 vsc9959_psfp_sgi_set(ocelot, &sgi); in vsc9959_psfp_sgi_table_del()
2245 struct felix_stream_gate *sgi; in vsc9959_psfp_filter_add() local
2265 size = struct_size(sgi, entries, a->gate.num_entries); in vsc9959_psfp_filter_add()
2266 sgi = kzalloc(size, GFP_KERNEL); in vsc9959_psfp_filter_add()
2267 if (!sgi) { in vsc9959_psfp_filter_add()
2271 vsc9959_psfp_parse_gate(a, sgi); in vsc9959_psfp_filter_add()
2272 ret = vsc9959_psfp_sgi_table_add(ocelot, sgi); in vsc9959_psfp_filter_add()
2274 kfree(sgi); in vsc9959_psfp_filter_add()
2278 sfi.sgid = sgi->index; in vsc9959_psfp_filter_add()
2279 kfree(sgi); in vsc9959_psfp_filter_add()