MCPcopy Create free account
hub / github.com/F-Stack/f-stack / fman_if_vsp_init

Function fman_if_vsp_init

dpdk/drivers/bus/dpaa/base/fman/fman.c:148–226  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

146}
147
148static void fman_if_vsp_init(struct __fman_if *__if)
149{
150 const phandle *prop;
151 int cell_index;
152 const struct device_node *dev;
153 size_t lenp;
154 const uint8_t mac_idx[] = {-1, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1};
155
156 if (__if->__if.mac_idx <= 8) {
157 for_each_compatible_node(dev, NULL,
158 "fsl,fman-port-1g-rx-extended-args") {
159 prop = of_get_property(dev, "cell-index", &lenp);
160 if (prop) {
161 cell_index = of_read_number(
162 &prop[0],
163 lenp / sizeof(phandle));
164 if (cell_index == mac_idx[__if->__if.mac_idx]) {
165 prop = of_get_property(
166 dev,
167 "vsp-window", &lenp);
168 if (prop) {
169 __if->__if.num_profiles =
170 of_read_number(
171 &prop[0], 1);
172 __if->__if.base_profile_id =
173 of_read_number(
174 &prop[1], 1);
175 }
176 }
177 }
178 }
179
180 for_each_compatible_node(dev, NULL,
181 "fsl,fman-port-op-extended-args") {
182 prop = of_get_property(dev, "cell-index", &lenp);
183
184 if (prop) {
185 cell_index = of_read_number(&prop[0],
186 lenp / sizeof(phandle));
187
188 if (cell_index == __if->__if.mac_idx) {
189 prop = of_get_property(dev,
190 "vsp-window",
191 &lenp);
192
193 if (prop) {
194 __if->__if.num_profiles =
195 of_read_number(&prop[0],
196 1);
197 __if->__if.base_profile_id =
198 of_read_number(&prop[1],
199 1);
200 }
201 }
202 }
203 }
204 } else {
205 for_each_compatible_node(dev, NULL,

Callers 1

fman_if_initFunction · 0.85

Calls 2

of_get_propertyFunction · 0.85
of_read_numberFunction · 0.85

Tested by

no test coverage detected