/alps/pcitool

To get this branch, use:
bzr branch http://suren.me/webbzr/alps/pcitool

« back to all changes in this revision

Viewing changes to pcilib/pci.c

  • Committer: Suren A. Chilingaryan
  • Date: 2016-02-23 06:20:33 UTC
  • mfrom: (346.1.18 pcitool)
  • Revision ID: csa@suren.me-20160223062033-mz8qkpm1a2oioveb
Merge Python scripting support from Vasiliy Chernov

Show diffs side-by-side

added added

removed removed

Lines of Context:
191
191
 
192
192
        if (!ctx->model)
193
193
            ctx->model = strdup(model?model:"pci");
 
194
            
 
195
        err = pcilib_py_add_script_dir(ctx, NULL);
 
196
        if (err) {
 
197
            pcilib_error("Error (%i) add script path to python path", err);
 
198
            pcilib_close(ctx);
 
199
            return NULL;
 
200
        }
 
201
        
194
202
        
195
203
        xmlerr = pcilib_init_xml(ctx, ctx->model);
196
204
        if ((xmlerr)&&(xmlerr != PCILIB_ERROR_NOTFOUND)) {
198
206
            pcilib_close(ctx);
199
207
            return NULL;
200
208
        }
 
209
        
201
210
 
202
211
            // We have found neither standard model nor XML
203
212
        if ((err)&&(xmlerr)) {
219
228
            pcilib_close(ctx);
220
229
            return NULL;
221
230
        }
222
 
        
223
231
        err = pcilib_init_event_engine(ctx);
224
232
        if (err) {
225
233
            pcilib_error("Error (%i) initializing event engine\n", err);
305
313
 
306
314
        if (ctx->event_plugin)
307
315
            pcilib_plugin_close(ctx->event_plugin);
308
 
        
309
 
        pcilib_free_py(ctx);
310
316
 
311
317
        if (ctx->locks.kmem)
312
318
            pcilib_free_locking(ctx);
348
354
 
349
355
        if (ctx->registers)
350
356
            free(ctx->registers);
351
 
        
 
357
            
352
358
        if (ctx->model)
353
359
            free(ctx->model);
354
360
 
355
361
        pcilib_free_xml(ctx);
 
362
        pcilib_free_py(ctx);
356
363
 
357
364
        if (ctx->handle >= 0)
358
365
            close(ctx->handle);