5 #define VERSION ((0<<8)|1)
11 int UDI_Install(char **Arguments);
12 int UDI_DetectDriver(void *Base);
13 int UDI_LoadDriver(void *Base);
16 MODULE_DEFINE(0, VERSION, UDI, UDI_Install, NULL, NULL);
17 tModuleLoader gUDI_Loader = {
18 NULL, "UDI", UDI_DetectDriver, UDI_LoadDriver, NULL
23 * \fn int UDI_Install(char **Arguments)
24 * \brief Stub intialisation routine
26 int UDI_Install(char **Arguments)
28 Module_RegisterLoader( &gUDI_Loader );
33 * \brief Detects if a driver should be loaded by the UDI subsystem
35 int UDI_DetectDriver(void *Base)
37 if( Binary_FindSymbol(Base, "udi_init_info", NULL) == 0) {
45 * \fn int UDI_LoadDriver(void *Base)
47 int UDI_LoadDriver(void *Base)
50 char *udiprops = NULL;
51 int udiprops_size = 0;
55 Log_Debug("UDI", "UDI_LoadDriver: (Base=%p)", Base);
57 if( Binary_FindSymbol(Base, "udi_init_info", (Uint*)&info) == 0) {
62 if( Binary_FindSymbol(Base, "_udiprops", (Uint*)&udiprops) == 0 ) {
63 Log_Warning("UDI", "_udiprops is not defined, this is usually bad");
66 Uint udiprops_end = 0;
70 if( Binary_FindSymbol(Base, "_udiprops_end", (Uint*)&udiprops_end) == 0)
71 Log_Warning("UDI", "_udiprops_end is not defined");
72 Log_Debug("UDI", "udiprops_end = %p", udiprops_end);
73 udiprops_size = udiprops_end - (Uint)udiprops;
74 Log_Debug("UDI", "udiprops = %p, udiprops_size = 0x%x", udiprops, udiprops_size);
76 Debug_HexDump("UDI_LoadDriver", udiprops, udiprops_size);
79 for( i = 0; i < udiprops_size; i++ )
81 if( udiprops[i] == '\0' )
85 Log_Debug("UDI", "nLines = %i", nLines);
87 udipropsptrs = malloc( sizeof(char*)*nLines );
88 udipropsptrs[0] = udiprops;
90 for( i = 0; i < udiprops_size; i++ )
92 if( udiprops[i] == '\0' ) {
93 //Log_Debug("UDI", "udipropsptrs[%i] = '%s'", j, udipropsptrs[j]);
94 udipropsptrs[j++] = &udiprops[i+1];
97 Log_Debug("UDI", "udipropsptrs[%i] = '%s'", j, udipropsptrs[j]);
98 Log_Debug("UDI", "udiprops = \"%s\"", udiprops);
102 Log("primary_init_info = %p = {", info->primary_init_info);
104 Log(" .mgmt_ops = %p = {", info->primary_init_info->mgmt_ops);
105 Log(" .usage_ind_op: %p() - 0x%02x",
106 info->primary_init_info->mgmt_ops->usage_ind_op,
107 info->primary_init_info->mgmt_op_flags[0]
109 Log(" .enumerate_req_op: %p() - 0x%02x",
110 info->primary_init_info->mgmt_ops->enumerate_req_op,
111 info->primary_init_info->mgmt_op_flags[1]
113 Log(" .devmgmt_req_op: %p() - 0x%02x",
114 info->primary_init_info->mgmt_ops->devmgmt_req_op,
115 info->primary_init_info->mgmt_op_flags[2]
117 Log(" .final_cleanup_req_op: %p() - 0x%02x",
118 info->primary_init_info->mgmt_ops->final_cleanup_req_op,
119 info->primary_init_info->mgmt_op_flags[3]
122 Log(" .mgmt_scratch_requirement = 0x%x", info->primary_init_info->mgmt_scratch_requirement);
123 Log(" .enumeration_attr_list_length = 0x%x", info->primary_init_info->enumeration_attr_list_length);
124 Log(" .rdata_size = 0x%x", info->primary_init_info->rdata_size);
125 Log(" .child_data_size = 0x%x", info->primary_init_info->child_data_size);
126 Log(" .per_parent_paths = 0x%x", info->primary_init_info->per_parent_paths);
129 Log("secondary_init_list = %p", info->secondary_init_list);
130 Log("ops_init_list = %p", info->ops_init_list);
132 for( i = 0; info->ops_init_list[i].ops_idx; i++ )
134 Log("info->ops_init_list[%i] = {", i);
135 Log(" .ops_idx = 0x%x", info->ops_init_list[i].ops_idx);
136 Log(" .meta_idx = 0x%x", info->ops_init_list[i].meta_idx);
137 Log(" .meta_ops_num = 0x%x", info->ops_init_list[i].meta_ops_num);
138 Log(" .chan_context_size = 0x%x", info->ops_init_list[i].chan_context_size);
139 Log(" .ops_vector = %p", info->ops_init_list[i].ops_vector);
140 // Log(" .op_flags = %p", info->ops_init_list[i].op_flags);