static int __axi_halt(int port) { int rc = 0; /* get device handle */ rc = daldevice_attach( DALDEVICEID_AXI, DALRPC_PORT_NAME, DALRPC_DEST_MODEM, &halt_dev_handle ); if (rc) { printk(KERN_ERR "%s: failed to attach AXI bus device (%d)\n", __func__, rc); goto fail_dal_attach_detach; } rc = dalrpc_fcn_0( DALRPC_AXI_HALT, halt_dev_handle, port ); if (rc) { printk(KERN_ERR "%s: AXI bus device (%d) failed to be HALTED\n", __func__, rc); } rc = dalrpc_fcn_0( DALRPC_AXI_UNHALT, halt_dev_handle, port); if (rc) { printk(KERN_ERR "%s: AXI bus device (%d) failed to be UNHALTED\n", __func__, rc); } daldevice_detach(halt_dev_handle); return 0; fail_dal_attach_detach: return 0; }
static int __axi_allocate(int mode) { int rc; /* get device handle */ rc = daldevice_attach(DALDEVICEID_AXI, DALRPC_PORT_NAME, DALRPC_DEST_MODEM, &cam_dev_handle); if (rc) { printk(KERN_ERR "%s: failed to attach AXI bus device (%d)\n", __func__, rc); goto fail_dal_attach_detach; } rc = dalrpc_fcn_0(DALRPC_AXI_ALLOCATE, cam_dev_handle, mode); if (rc) { printk(KERN_ERR "%s: AXI bus device (%d) failed to be configured\n", __func__, rc); goto fail_dal_fcn_0; } return 0; fail_dal_fcn_0: (void)daldevice_detach(cam_dev_handle); cam_dev_handle = NULL; fail_dal_attach_detach: return rc; }
static int __axi_free(int mode) { int rc = 0; if (!cam_dev_handle) return rc; rc = dalrpc_fcn_0(DALRPC_AXI_FREE, cam_dev_handle, mode); if (rc) { printk(KERN_ERR "%s: AXI bus device (%d) failed to be configured\n", __func__, rc); goto fail_dal_fcn_0; } /* close device handle */ rc = daldevice_detach(cam_dev_handle); if (rc) { printk(KERN_ERR "%s: failed to detach AXI bus device (%d)\n", __func__, rc); goto fail_dal_attach_detach; } cam_dev_handle = NULL; return 0; fail_dal_fcn_0: (void)daldevice_detach(cam_dev_handle); cam_dev_handle = NULL; fail_dal_attach_detach: return rc; }
static int axi_configure_bridge_grfx_sync_mode(int bridge_mode) { int rc; void *dev_handle; /* get device handle */ rc = daldevice_attach( DALDEVICEID_AXI, DALRPC_PORT_NAME, DALRPC_DEST_MODEM, &dev_handle ); if (rc) { printk(KERN_ERR "%s: failed to attach AXI bus device (%d)\n", __func__, rc); goto fail_dal_attach_detach; } /* call ConfigureBridge */ rc = dalrpc_fcn_0( DALRPC_AXI_CONFIGURE_BRIDGE, dev_handle, bridge_mode ); if (rc) { printk(KERN_ERR "%s: AXI bus device (%d) failed to be configured\n", __func__, rc); goto fail_dal_fcn_0; } /* close device handle */ rc = daldevice_detach(dev_handle); if (rc) { printk(KERN_ERR "%s: failed to detach AXI bus device (%d)\n", __func__, rc); goto fail_dal_attach_detach; } return 0; fail_dal_fcn_0: (void)daldevice_detach(dev_handle); fail_dal_attach_detach: return rc; }