Lines Matching refs:cnfg
134 struct dev_info *cfcnfg_get_phyid(struct cfcnfg *cnfg,
141 if (cnfg->phy_layers[i].id == i &&
142 cnfg->phy_layers[i].pref == phy_pref &&
143 cnfg->phy_layers[i].frm_layer != NULL) {
144 caif_assert(cnfg->phy_layers != NULL);
145 caif_assert(cnfg->phy_layers[i].id == i);
146 return &cnfg->phy_layers[i].dev_info;
151 if (cnfg->phy_layers[i].id == i) {
152 caif_assert(cnfg->phy_layers != NULL);
153 caif_assert(cnfg->phy_layers[i].id == i);
154 return &cnfg->phy_layers[i].dev_info;
161 static struct cfcnfg_phyinfo *cfcnfg_get_phyinfo(struct cfcnfg *cnfg,
167 if (cnfg->phy_layers[i].frm_layer != NULL &&
168 cnfg->phy_layers[i].id == phyid)
169 return &cnfg->phy_layers[i];
173 int cfcnfg_get_named(struct cfcnfg *cnfg, char *name)
179 if (cnfg->phy_layers[i].frm_layer != NULL
180 && strcmp(cnfg->phy_layers[i].phy_layer->name,
182 return cnfg->phy_layers[i].frm_layer->id;
187 int cfcnfg_disconn_adapt_layer(struct cfcnfg *cnfg, struct cflayer *adap_layer)
201 servl = cfmuxl_remove_uplayer(cnfg->mux, channel_id);
205 ret = cfctrl_linkdown_req(cnfg->ctrl, channel_id, adap_layer);
217 phyinfo = cfcnfg_get_phyinfo(cnfg, phyid);
243 cfctrl_cancel_req(cnfg->ctrl, adap_layer);
270 int cfcnfg_add_adaptation_layer(struct cfcnfg *cnfg,
290 frml = cnfg->phy_layers[param->phyid].frm_layer;
296 caif_assert(param->phyid == cnfg->phy_layers[param->phyid].id);
297 caif_assert(cnfg->phy_layers[param->phyid].frm_layer->id ==
299 caif_assert(cnfg->phy_layers[param->phyid].phy_layer->id ==
302 *ifindex = cnfg->phy_layers[param->phyid].ifindex;
305 (cnfg->phy_layers[param->phyid].use_stx ? 1 : 0);
309 cfctrl_enum_req(cnfg->ctrl, param->phyid);
310 return cfctrl_linkup_request(cnfg->ctrl, param, adap_layer);
326 struct cfcnfg *cnfg = container_obj(layer);
335 cfctrl_linkdown_req(cnfg->ctrl, channel_id, NULL);
339 caif_assert(cnfg != NULL);
341 phyinfo = &cnfg->phy_layers[phyid];
385 layer_set_dn(servicel, cnfg->mux);
386 cfmuxl_set_uplayer(cnfg->mux, servicel, channel_id);
394 cfcnfg_add_phy_layer(struct cfcnfg *cnfg, enum cfcnfg_phy_type phy_type,
404 if (cnfg->phy_layers[cnfg->last_phyid].frm_layer == NULL) {
405 *phyid = cnfg->last_phyid;
408 cnfg->last_phyid =
409 (cnfg->last_phyid % (MAX_PHY_LAYERS - 1)) + 1;
413 if (cnfg->phy_layers[i].frm_layer == NULL) {
444 cnfg->phy_layers[*phyid].pref = pref;
445 cnfg->phy_layers[*phyid].id = *phyid;
446 cnfg->phy_layers[*phyid].dev_info.id = *phyid;
447 cnfg->phy_layers[*phyid].dev_info.dev = dev;
448 cnfg->phy_layers[*phyid].phy_layer = phy_layer;
449 cnfg->phy_layers[*phyid].phy_ref_count = 0;
450 cnfg->phy_layers[*phyid].ifindex = dev->ifindex;
451 cnfg->phy_layers[*phyid].use_stx = stx;
452 cnfg->phy_layers[*phyid].use_fcs = fcs;
460 cnfg->phy_layers[*phyid].frm_layer = frml;
461 cfmuxl_set_dnlayer(cnfg->mux, frml, *phyid);
462 layer_set_up(frml, cnfg->mux);
477 int cfcnfg_del_phy_layer(struct cfcnfg *cnfg, struct cflayer *phy_layer)
482 caif_assert(phyid == cnfg->phy_layers[phyid].id);
483 caif_assert(phy_layer == cnfg->phy_layers[phyid].phy_layer);
485 caif_assert(cnfg->phy_layers[phyid].frm_layer->id == phyid);
487 memset(&cnfg->phy_layers[phy_layer->id], 0,
489 frml = cfmuxl_remove_dnlayer(cnfg->mux, phy_layer->id);