X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;ds=sidebyside;f=KernelLand%2FModules%2FInterfaces%2FUDI%2Fmanagement_agent.c;h=0e1c87e798e306a60a06d5c672d6819e6e27718e;hb=fb13a50bc14688a20dc37acbbbbe23f56bf63c41;hp=eb441aa4f10d8f059a006454e75dae92ff835272;hpb=40b1565117870d9124e3afee02d008e0bd9fcd66;p=tpg%2Facess2.git diff --git a/KernelLand/Modules/Interfaces/UDI/management_agent.c b/KernelLand/Modules/Interfaces/UDI/management_agent.c index eb441aa4..0e1c87e7 100644 --- a/KernelLand/Modules/Interfaces/UDI/management_agent.c +++ b/KernelLand/Modules/Interfaces/UDI/management_agent.c @@ -6,10 +6,10 @@ * - Managment Agent */ #define DEBUG 1 -#include #include -#include "udi_internal.h" -#include "udi_ma.h" +#include +#include +#include // === CONSTANTS === enum { @@ -46,7 +46,7 @@ tUDI_DriverInstance *UDI_MA_CreateInstance(tUDI_DriverModule *DriverModule) inst->ManagementChannel = UDI_CreateChannel_Blank(&cMetaLang_Management); UDI_BindChannel_Raw(inst->ManagementChannel, true, - inst, 0, inst->Regions[0]->InitContext, pri_init->mgmt_ops); + inst, 0, 0, inst->Regions[0]->InitContext, pri_init->mgmt_ops); // UDI_BindChannel_Raw(inst->ManagementChannel, false, // NULL, 1, inst, &cUDI_MgmtOpsList); // TODO: ops list for management agent? @@ -111,6 +111,7 @@ void UDI_MA_BeginEnumeration(tUDI_DriverInstance *Inst) int UDI_MA_CheckDeviceMatch(int nDevAttr, udi_instance_attr_list_t *DevAttrs, int nEnumAttr, udi_instance_attr_list_t *EnumAttrs) { + // TODO: Ask metalangauge instead int n_matches = 0; for( int i = 0; i < nDevAttr; i ++ ) { @@ -149,7 +150,8 @@ int UDI_MA_CheckDeviceMatch(int nDevAttr, udi_instance_attr_list_t *DevAttrs, void UDI_MA_AddChild(udi_enumerate_cb_t *cb, udi_index_t ops_idx) { // Current side is MA, other is instance - tUDI_DriverInstance *inst = UDI_int_ChannelGetInstance( UDI_GCB(cb), true ); + // TODO: Get region index too? + tUDI_DriverInstance *inst = UDI_int_ChannelGetInstance( UDI_GCB(cb), true, NULL ); //LOG("inst = %p", inst); // Search for existing child with same child_ID and ops @@ -249,6 +251,8 @@ tUDI_DriverInstance *UDI_MA_CreateChildInstance(tUDI_DriverModule *Module, // Found a match, so create an instance and bind it tUDI_DriverInstance *inst = UDI_MA_CreateInstance(Module); ChildBinding->BoundInstance = inst; + inst->Parent = ParentInstance; + inst->ParentChildBinding = ChildBinding; // TODO: Handle multi-parent drivers ASSERTC(Module->nParents, ==, 1); @@ -257,9 +261,10 @@ tUDI_DriverInstance *UDI_MA_CreateChildInstance(tUDI_DriverModule *Module, tUDI_BindOps *parent = &Module->Parents[0]; udi_channel_t channel = UDI_CreateChannel_Blank( UDI_int_GetMetaLang(inst, parent->meta_idx) ); - UDI_BindChannel(channel,true, inst, parent->ops_idx, parent->region_idx); + UDI_BindChannel(channel,true, inst, parent->ops_idx, parent->region_idx, NULL,false,0); UDI_BindChannel(channel,false, - ParentInstance, ChildBinding->Ops->ops_idx, ChildBinding->BindOps->region_idx); + ParentInstance, ChildBinding->Ops->ops_idx, ChildBinding->BindOps->region_idx, + NULL, true, ChildBinding->ChildID); udi_channel_event_cb_t ev_cb; memset(&ev_cb, 0, sizeof(ev_cb));