aboutsummaryrefslogtreecommitdiff
path: root/drivers/isdn/hardware/eicon/os_4bri.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/isdn/hardware/eicon/os_4bri.c')
-rw-r--r--drivers/isdn/hardware/eicon/os_4bri.c352
1 files changed, 176 insertions, 176 deletions
diff --git a/drivers/isdn/hardware/eicon/os_4bri.c b/drivers/isdn/hardware/eicon/os_4bri.c
index cb7616c5b60a..1891246807ed 100644
--- a/drivers/isdn/hardware/eicon/os_4bri.c
+++ b/drivers/isdn/hardware/eicon/os_4bri.c
@@ -27,12 +27,12 @@ static dword diva_xdiLoadFileLength = 0;
extern void prepare_qBri_functions(PISDN_ADAPTER IoAdapter);
extern void prepare_qBri2_functions(PISDN_ADAPTER IoAdapter);
extern void diva_xdi_display_adapter_features(int card);
-extern void diva_add_slave_adapter(diva_os_xdi_adapter_t * a);
+extern void diva_add_slave_adapter(diva_os_xdi_adapter_t *a);
extern int qBri_FPGA_download(PISDN_ADAPTER IoAdapter);
extern void start_qBri_hardware(PISDN_ADAPTER IoAdapter);
-extern int diva_card_read_xlog(diva_os_xdi_adapter_t * a);
+extern int diva_card_read_xlog(diva_os_xdi_adapter_t *a);
/*
** LOCALS
@@ -57,23 +57,23 @@ static unsigned long _4bri_v2_bri_bar_length[4] = {
};
-static int diva_4bri_cleanup_adapter(diva_os_xdi_adapter_t * a);
-static int _4bri_get_serial_number(diva_os_xdi_adapter_t * a);
+static int diva_4bri_cleanup_adapter(diva_os_xdi_adapter_t *a);
+static int _4bri_get_serial_number(diva_os_xdi_adapter_t *a);
static int diva_4bri_cmd_card_proc(struct _diva_os_xdi_adapter *a,
- diva_xdi_um_cfg_cmd_t * cmd,
+ diva_xdi_um_cfg_cmd_t *cmd,
int length);
-static int diva_4bri_cleanup_slave_adapters(diva_os_xdi_adapter_t * a);
-static int diva_4bri_write_fpga_image(diva_os_xdi_adapter_t * a,
- byte * data, dword length);
+static int diva_4bri_cleanup_slave_adapters(diva_os_xdi_adapter_t *a);
+static int diva_4bri_write_fpga_image(diva_os_xdi_adapter_t *a,
+ byte *data, dword length);
static int diva_4bri_reset_adapter(PISDN_ADAPTER IoAdapter);
static int diva_4bri_write_sdram_block(PISDN_ADAPTER IoAdapter,
dword address,
- const byte * data,
+ const byte *data,
dword length, dword limit);
static int diva_4bri_start_adapter(PISDN_ADAPTER IoAdapter,
dword start_address, dword features);
static int check_qBri_interrupt(PISDN_ADAPTER IoAdapter);
-static int diva_4bri_stop_adapter(diva_os_xdi_adapter_t * a);
+static int diva_4bri_stop_adapter(diva_os_xdi_adapter_t *a);
static int _4bri_is_rev_2_card(int card_ordinal)
{
@@ -112,8 +112,8 @@ static void diva_4bri_set_addresses(diva_os_xdi_adapter_t *a)
a->resources.pci.mem_type_id[MEM_TYPE_PROM] = 0;
/*
- Set up hardware related pointers
- */
+ Set up hardware related pointers
+ */
a->xdi_adapter.Address = a->resources.pci.addr[2]; /* BAR2 SDRAM */
a->xdi_adapter.Address += c_offset;
@@ -121,15 +121,15 @@ static void diva_4bri_set_addresses(diva_os_xdi_adapter_t *a)
a->xdi_adapter.ram = a->resources.pci.addr[2]; /* BAR2 SDRAM */
a->xdi_adapter.ram += c_offset + (offset - MQ_SHARED_RAM_SIZE);
-
+
a->xdi_adapter.reset = a->resources.pci.addr[0]; /* BAR0 CONFIG */
/*
- ctlReg contains the register address for the MIPS CPU reset control
- */
+ ctlReg contains the register address for the MIPS CPU reset control
+ */
a->xdi_adapter.ctlReg = a->resources.pci.addr[3]; /* BAR3 CNTRL */
/*
- prom contains the register address for FPGA and EEPROM programming
- */
+ prom contains the register address for FPGA and EEPROM programming
+ */
a->xdi_adapter.prom = &a->xdi_adapter.reset[0x6E];
}
@@ -141,7 +141,7 @@ static void diva_4bri_set_addresses(diva_os_xdi_adapter_t *a)
**
** Called by master adapter, that will initialize and add slave adapters
*/
-int diva_4bri_init_card(diva_os_xdi_adapter_t * a)
+int diva_4bri_init_card(diva_os_xdi_adapter_t *a)
{
int bar, i;
byte __iomem *p;
@@ -168,48 +168,48 @@ int diva_4bri_init_card(diva_os_xdi_adapter_t * a)
DBG_TRC(("SDRAM_LENGTH=%08x, tasks=%d, factor=%d",
bar_length[2], tasks, factor))
- /*
- Get Serial Number
- The serial number of 4BRI is accessible in accordance with PCI spec
- via command register located in configuration space, also we do not
- have to map any BAR before we can access it
- */
- if (!_4bri_get_serial_number(a)) {
- DBG_ERR(("A: 4BRI can't get Serial Number"))
- diva_4bri_cleanup_adapter(a);
- return (-1);
- }
+ /*
+ Get Serial Number
+ The serial number of 4BRI is accessible in accordance with PCI spec
+ via command register located in configuration space, also we do not
+ have to map any BAR before we can access it
+ */
+ if (!_4bri_get_serial_number(a)) {
+ DBG_ERR(("A: 4BRI can't get Serial Number"))
+ diva_4bri_cleanup_adapter(a);
+ return (-1);
+ }
/*
- Set properties
- */
+ Set properties
+ */
a->xdi_adapter.Properties = CardProperties[a->CardOrdinal];
DBG_LOG(("Load %s, SN:%ld, bus:%02x, func:%02x",
a->xdi_adapter.Properties.Name,
a->xdi_adapter.serialNo,
a->resources.pci.bus, a->resources.pci.func))
- /*
- First initialization step: get and check hardware resoures.
- Do not map resources and do not access card at this step
- */
- for (bar = 0; bar < 4; bar++) {
- a->resources.pci.bar[bar] =
- divasa_get_pci_bar(a->resources.pci.bus,
- a->resources.pci.func, bar,
- a->resources.pci.hdev);
- if (!a->resources.pci.bar[bar]
- || (a->resources.pci.bar[bar] == 0xFFFFFFF0)) {
- DBG_ERR(
- ("A: invalid bar[%d]=%08x", bar,
- a->resources.pci.bar[bar]))
- return (-1);
+ /*
+ First initialization step: get and check hardware resoures.
+ Do not map resources and do not access card at this step
+ */
+ for (bar = 0; bar < 4; bar++) {
+ a->resources.pci.bar[bar] =
+ divasa_get_pci_bar(a->resources.pci.bus,
+ a->resources.pci.func, bar,
+ a->resources.pci.hdev);
+ if (!a->resources.pci.bar[bar]
+ || (a->resources.pci.bar[bar] == 0xFFFFFFF0)) {
+ DBG_ERR(
+ ("A: invalid bar[%d]=%08x", bar,
+ a->resources.pci.bar[bar]))
+ return (-1);
+ }
}
- }
a->resources.pci.irq =
- (byte) divasa_get_pci_irq(a->resources.pci.bus,
- a->resources.pci.func,
- a->resources.pci.hdev);
+ (byte) divasa_get_pci_irq(a->resources.pci.bus,
+ a->resources.pci.func,
+ a->resources.pci.hdev);
if (!a->resources.pci.irq) {
DBG_ERR(("A: invalid irq"));
return (-1);
@@ -218,30 +218,30 @@ int diva_4bri_init_card(diva_os_xdi_adapter_t * a)
a->xdi_adapter.sdram_bar = a->resources.pci.bar[2];
/*
- Map all MEMORY BAR's
- */
+ Map all MEMORY BAR's
+ */
for (bar = 0; bar < 4; bar++) {
if (bar != 1) { /* ignore I/O */
a->resources.pci.addr[bar] =
- divasa_remap_pci_bar(a, bar, a->resources.pci.bar[bar],
- bar_length[bar]);
+ divasa_remap_pci_bar(a, bar, a->resources.pci.bar[bar],
+ bar_length[bar]);
if (!a->resources.pci.addr[bar]) {
DBG_ERR(("A: 4BRI: can't map bar[%d]", bar))
- diva_4bri_cleanup_adapter(a);
+ diva_4bri_cleanup_adapter(a);
return (-1);
}
}
}
/*
- Register I/O port
- */
+ Register I/O port
+ */
sprintf(&a->port_name[0], "DIVA 4BRI %ld", (long) a->xdi_adapter.serialNo);
if (diva_os_register_io_port(a, 1, a->resources.pci.bar[1],
bar_length[1], &a->port_name[0], 1)) {
DBG_ERR(("A: 4BRI: can't register bar[1]"))
- diva_4bri_cleanup_adapter(a);
+ diva_4bri_cleanup_adapter(a);
return (-1);
}
@@ -249,23 +249,23 @@ int diva_4bri_init_card(diva_os_xdi_adapter_t * a)
(void *) (unsigned long) a->resources.pci.bar[1];
/*
- Set cleanup pointer for base adapter only, so slave adapter
- will be unable to get cleanup
- */
+ Set cleanup pointer for base adapter only, so slave adapter
+ will be unable to get cleanup
+ */
a->interface.cleanup_adapter_proc = diva_4bri_cleanup_adapter;
/*
- Create slave adapters
- */
+ Create slave adapters
+ */
if (tasks > 1) {
if (!(a->slave_adapters[0] =
- (diva_os_xdi_adapter_t *) diva_os_malloc(0, sizeof(*a))))
+ (diva_os_xdi_adapter_t *) diva_os_malloc(0, sizeof(*a))))
{
diva_4bri_cleanup_adapter(a);
return (-1);
}
if (!(a->slave_adapters[1] =
- (diva_os_xdi_adapter_t *) diva_os_malloc(0, sizeof(*a))))
+ (diva_os_xdi_adapter_t *) diva_os_malloc(0, sizeof(*a))))
{
diva_os_free(0, a->slave_adapters[0]);
a->slave_adapters[0] = NULL;
@@ -273,7 +273,7 @@ int diva_4bri_init_card(diva_os_xdi_adapter_t * a)
return (-1);
}
if (!(a->slave_adapters[2] =
- (diva_os_xdi_adapter_t *) diva_os_malloc(0, sizeof(*a))))
+ (diva_os_xdi_adapter_t *) diva_os_malloc(0, sizeof(*a))))
{
diva_os_free(0, a->slave_adapters[0]);
diva_os_free(0, a->slave_adapters[1]);
@@ -293,10 +293,10 @@ int diva_4bri_init_card(diva_os_xdi_adapter_t * a)
adapter_list[3] = a->slave_adapters[2];
/*
- Allocate slave list
- */
+ Allocate slave list
+ */
quadro_list =
- (PADAPTER_LIST_ENTRY) diva_os_malloc(0, sizeof(*quadro_list));
+ (PADAPTER_LIST_ENTRY) diva_os_malloc(0, sizeof(*quadro_list));
if (!(a->slave_list = quadro_list)) {
for (i = 0; i < (tasks - 1); i++) {
diva_os_free(0, a->slave_adapters[i]);
@@ -308,14 +308,14 @@ int diva_4bri_init_card(diva_os_xdi_adapter_t * a)
memset(quadro_list, 0x00, sizeof(*quadro_list));
/*
- Set interfaces
- */
+ Set interfaces
+ */
a->xdi_adapter.QuadroList = quadro_list;
for (i = 0; i < tasks; i++) {
adapter_list[i]->xdi_adapter.ControllerNumber = i;
adapter_list[i]->xdi_adapter.tasks = tasks;
quadro_list->QuadroAdapter[i] =
- &adapter_list[i]->xdi_adapter;
+ &adapter_list[i]->xdi_adapter;
}
for (i = 0; i < tasks; i++) {
@@ -324,21 +324,21 @@ int diva_4bri_init_card(diva_os_xdi_adapter_t * a)
diva_current->dsp_mask = 0x00000003;
diva_current->xdi_adapter.a.io =
- &diva_current->xdi_adapter;
+ &diva_current->xdi_adapter;
diva_current->xdi_adapter.DIRequest = request;
diva_current->interface.cmd_proc = diva_4bri_cmd_card_proc;
diva_current->xdi_adapter.Properties =
- CardProperties[a->CardOrdinal];
+ CardProperties[a->CardOrdinal];
diva_current->CardOrdinal = a->CardOrdinal;
diva_current->xdi_adapter.Channels =
- CardProperties[a->CardOrdinal].Channels;
+ CardProperties[a->CardOrdinal].Channels;
diva_current->xdi_adapter.e_max =
- CardProperties[a->CardOrdinal].E_info;
+ CardProperties[a->CardOrdinal].E_info;
diva_current->xdi_adapter.e_tbl =
- diva_os_malloc(0,
- diva_current->xdi_adapter.e_max *
- sizeof(E_INFO));
+ diva_os_malloc(0,
+ diva_current->xdi_adapter.e_max *
+ sizeof(E_INFO));
if (!diva_current->xdi_adapter.e_tbl) {
diva_4bri_cleanup_slave_adapters(a);
@@ -370,8 +370,8 @@ int diva_4bri_init_card(diva_os_xdi_adapter_t * a)
strcpy(diva_current->xdi_adapter.req_soft_isr. dpc_thread_name, "kdivas4brid");
- if (diva_os_initialize_soft_isr (&diva_current->xdi_adapter.req_soft_isr, DIDpcRoutine,
- &diva_current->xdi_adapter)) {
+ if (diva_os_initialize_soft_isr(&diva_current->xdi_adapter.req_soft_isr, DIDpcRoutine,
+ &diva_current->xdi_adapter)) {
diva_4bri_cleanup_slave_adapters(a);
diva_4bri_cleanup_adapter(a);
for (i = 1; i < (tasks - 1); i++) {
@@ -381,10 +381,10 @@ int diva_4bri_init_card(diva_os_xdi_adapter_t * a)
}
/*
- Do not initialize second DPC - only one thread will be created
- */
+ Do not initialize second DPC - only one thread will be created
+ */
diva_current->xdi_adapter.isr_soft_isr.object =
- diva_current->xdi_adapter.req_soft_isr.object;
+ diva_current->xdi_adapter.req_soft_isr.object;
}
if (v2) {
@@ -397,12 +397,12 @@ int diva_4bri_init_card(diva_os_xdi_adapter_t * a)
diva_current = adapter_list[i];
if (i)
memcpy(&diva_current->resources, &a->resources, sizeof(divas_card_resources_t));
- diva_current->resources.pci.qoffset = (a->xdi_adapter.MemorySize >> factor);
+ diva_current->resources.pci.qoffset = (a->xdi_adapter.MemorySize >> factor);
}
/*
- Set up hardware related pointers
- */
+ Set up hardware related pointers
+ */
a->xdi_adapter.cfg = (void *) (unsigned long) a->resources.pci.bar[0]; /* BAR0 CONFIG */
a->xdi_adapter.port = (void *) (unsigned long) a->resources.pci.bar[1]; /* BAR1 */
a->xdi_adapter.ctlReg = (void *) (unsigned long) a->resources.pci.bar[3]; /* BAR3 CNTRL */
@@ -415,21 +415,21 @@ int diva_4bri_init_card(diva_os_xdi_adapter_t * a)
Slave->sdram_bar = a->xdi_adapter.sdram_bar;
if (i) {
Slave->serialNo = ((dword) (Slave->ControllerNumber << 24)) |
- a->xdi_adapter.serialNo;
+ a->xdi_adapter.serialNo;
Slave->cardType = a->xdi_adapter.cardType;
}
}
/*
- reset contains the base address for the PLX 9054 register set
- */
+ reset contains the base address for the PLX 9054 register set
+ */
p = DIVA_OS_MEM_ATTACH_RESET(&a->xdi_adapter);
WRITE_BYTE(&p[PLX9054_INTCSR], 0x00); /* disable PCI interrupts */
DIVA_OS_MEM_DETACH_RESET(&a->xdi_adapter, p);
/*
- Set IRQ handler
- */
+ Set IRQ handler
+ */
a->xdi_adapter.irq_info.irq_nr = a->resources.pci.irq;
sprintf(a->xdi_adapter.irq_info.irq_name, "DIVA 4BRI %ld",
(long) a->xdi_adapter.serialNo);
@@ -447,8 +447,8 @@ int diva_4bri_init_card(diva_os_xdi_adapter_t * a)
a->xdi_adapter.irq_info.registered = 1;
/*
- Add three slave adapters
- */
+ Add three slave adapters
+ */
if (tasks > 1) {
diva_add_slave_adapter(adapter_list[1]);
diva_add_slave_adapter(adapter_list[2]);
@@ -466,33 +466,33 @@ int diva_4bri_init_card(diva_os_xdi_adapter_t * a)
** this is guaranteed by design: cleanup callback is set
** by master adapter only
*/
-static int diva_4bri_cleanup_adapter(diva_os_xdi_adapter_t * a)
+static int diva_4bri_cleanup_adapter(diva_os_xdi_adapter_t *a)
{
int bar;
/*
- Stop adapter if running
- */
+ Stop adapter if running
+ */
if (a->xdi_adapter.Initialized) {
diva_4bri_stop_adapter(a);
}
/*
- Remove IRQ handler
- */
+ Remove IRQ handler
+ */
if (a->xdi_adapter.irq_info.registered) {
diva_os_remove_irq(a, a->xdi_adapter.irq_info.irq_nr);
}
a->xdi_adapter.irq_info.registered = 0;
/*
- Free DPC's and spin locks on all adapters
- */
+ Free DPC's and spin locks on all adapters
+ */
diva_4bri_cleanup_slave_adapters(a);
/*
- Unmap all BARS
- */
+ Unmap all BARS
+ */
for (bar = 0; bar < 4; bar++) {
if (bar != 1) {
if (a->resources.pci.bar[bar]
@@ -505,8 +505,8 @@ static int diva_4bri_cleanup_adapter(diva_os_xdi_adapter_t * a)
}
/*
- Unregister I/O
- */
+ Unregister I/O
+ */
if (a->resources.pci.bar[1] && a->resources.pci.addr[1]) {
diva_os_register_io_port(a, 0, a->resources.pci.bar[1],
_4bri_is_rev_2_card(a->
@@ -526,7 +526,7 @@ static int diva_4bri_cleanup_adapter(diva_os_xdi_adapter_t * a)
return (0);
}
-static int _4bri_get_serial_number(diva_os_xdi_adapter_t * a)
+static int _4bri_get_serial_number(diva_os_xdi_adapter_t *a)
{
dword data[64];
dword serNo;
@@ -551,13 +551,13 @@ static int _4bri_get_serial_number(diva_os_xdi_adapter_t * a)
}
if (j >= 5) {
DBG_ERR(("EEPROM[%d] read failed (0x%x)", i * 4, addr))
- return (0);
+ return (0);
}
PCIread(Bus, Slot, 0x50, &data[i], sizeof(data[i]), hdev);
}
DBG_BLK(((char *) &data[0], sizeof(data)))
- serNo = data[32];
+ serNo = data[32];
if (serNo == 0 || serNo == 0xffffffff)
serNo = data[63];
@@ -572,13 +572,13 @@ static int _4bri_get_serial_number(diva_os_xdi_adapter_t * a)
DBG_REG(("Serial No. : %ld", a->xdi_adapter.serialNo))
- return (serNo);
+ return (serNo);
}
/*
** Release resources of slave adapters
*/
-static int diva_4bri_cleanup_slave_adapters(diva_os_xdi_adapter_t * a)
+static int diva_4bri_cleanup_slave_adapters(diva_os_xdi_adapter_t *a)
{
diva_os_xdi_adapter_t *adapter_list[4];
diva_os_xdi_adapter_t *diva_current;
@@ -625,24 +625,24 @@ static int diva_4bri_cleanup_slave_adapters(diva_os_xdi_adapter_t * a)
static int
diva_4bri_cmd_card_proc(struct _diva_os_xdi_adapter *a,
- diva_xdi_um_cfg_cmd_t * cmd, int length)
+ diva_xdi_um_cfg_cmd_t *cmd, int length)
{
int ret = -1;
if (cmd->adapter != a->controller) {
DBG_ERR(("A: 4bri_cmd, invalid controller=%d != %d",
cmd->adapter, a->controller))
- return (-1);
+ return (-1);
}
switch (cmd->command) {
case DIVA_XDI_UM_CMD_GET_CARD_ORDINAL:
a->xdi_mbox.data_length = sizeof(dword);
a->xdi_mbox.data =
- diva_os_malloc(0, a->xdi_mbox.data_length);
+ diva_os_malloc(0, a->xdi_mbox.data_length);
if (a->xdi_mbox.data) {
*(dword *) a->xdi_mbox.data =
- (dword) a->CardOrdinal;
+ (dword) a->CardOrdinal;
a->xdi_mbox.status = DIVA_XDI_MBOX_BUSY;
ret = 0;
}
@@ -651,10 +651,10 @@ diva_4bri_cmd_card_proc(struct _diva_os_xdi_adapter *a,
case DIVA_XDI_UM_CMD_GET_SERIAL_NR:
a->xdi_mbox.data_length = sizeof(dword);
a->xdi_mbox.data =
- diva_os_malloc(0, a->xdi_mbox.data_length);
+ diva_os_malloc(0, a->xdi_mbox.data_length);
if (a->xdi_mbox.data) {
*(dword *) a->xdi_mbox.data =
- (dword) a->xdi_adapter.serialNo;
+ (dword) a->xdi_adapter.serialNo;
a->xdi_mbox.status = DIVA_XDI_MBOX_BUSY;
ret = 0;
}
@@ -663,11 +663,11 @@ diva_4bri_cmd_card_proc(struct _diva_os_xdi_adapter *a,
case DIVA_XDI_UM_CMD_GET_PCI_HW_CONFIG:
if (!a->xdi_adapter.ControllerNumber) {
/*
- Only master adapter can access hardware config
- */
+ Only master adapter can access hardware config
+ */
a->xdi_mbox.data_length = sizeof(dword) * 9;
a->xdi_mbox.data =
- diva_os_malloc(0, a->xdi_mbox.data_length);
+ diva_os_malloc(0, a->xdi_mbox.data_length);
if (a->xdi_mbox.data) {
int i;
dword *data = (dword *) a->xdi_mbox.data;
@@ -686,7 +686,7 @@ diva_4bri_cmd_card_proc(struct _diva_os_xdi_adapter *a,
if (!a->xdi_adapter.ControllerNumber) {
a->xdi_mbox.data_length = sizeof(dword);
a->xdi_mbox.data =
- diva_os_malloc(0, a->xdi_mbox.data_length);
+ diva_os_malloc(0, a->xdi_mbox.data_length);
if (a->xdi_mbox.data) {
dword *data = (dword *) a->xdi_mbox.data;
if (!a->xdi_adapter.ram
@@ -709,11 +709,11 @@ diva_4bri_cmd_card_proc(struct _diva_os_xdi_adapter *a,
case DIVA_XDI_UM_CMD_WRITE_FPGA:
if (!a->xdi_adapter.ControllerNumber) {
ret =
- diva_4bri_write_fpga_image(a,
- (byte *) & cmd[1],
- cmd->command_data.
- write_fpga.
- image_length);
+ diva_4bri_write_fpga_image(a,
+ (byte *)&cmd[1],
+ cmd->command_data.
+ write_fpga.
+ image_length);
}
break;
@@ -754,12 +754,12 @@ diva_4bri_cmd_card_proc(struct _diva_os_xdi_adapter *a,
case DIVA_XDI_UM_CMD_SET_PROTOCOL_FEATURES:
if (!a->xdi_adapter.ControllerNumber) {
a->xdi_adapter.features =
- cmd->command_data.features.features;
+ cmd->command_data.features.features;
a->xdi_adapter.a.protocol_capabilities =
- a->xdi_adapter.features;
+ a->xdi_adapter.features;
DBG_TRC(("Set raw protocol features (%08x)",
a->xdi_adapter.features))
- ret = 0;
+ ret = 0;
}
break;
@@ -777,16 +777,16 @@ diva_4bri_cmd_card_proc(struct _diva_os_xdi_adapter *a,
if (!a->xdi_adapter.ControllerNumber
&& a->xdi_adapter.Address) {
if (
- (a->xdi_mbox.data_length =
- cmd->command_data.read_sdram.length)) {
+ (a->xdi_mbox.data_length =
+ cmd->command_data.read_sdram.length)) {
if (
- (a->xdi_mbox.data_length +
- cmd->command_data.read_sdram.offset) <
- a->xdi_adapter.MemorySize) {
+ (a->xdi_mbox.data_length +
+ cmd->command_data.read_sdram.offset) <
+ a->xdi_adapter.MemorySize) {
a->xdi_mbox.data =
- diva_os_malloc(0,
- a->xdi_mbox.
- data_length);
+ diva_os_malloc(0,
+ a->xdi_mbox.
+ data_length);
if (a->xdi_mbox.data) {
byte __iomem *p = DIVA_OS_MEM_ATTACH_ADDRESS(&a->xdi_adapter);
byte __iomem *src = p;
@@ -810,7 +810,7 @@ diva_4bri_cmd_card_proc(struct _diva_os_xdi_adapter *a,
default:
DBG_ERR(("A: A(%d) invalid cmd=%d", a->controller,
cmd->command))
- }
+ }
return (ret);
}
@@ -838,7 +838,7 @@ void diva_os_set_qBri2_functions(PISDN_ADAPTER IoAdapter)
}
static int
-diva_4bri_write_fpga_image(diva_os_xdi_adapter_t * a, byte * data,
+diva_4bri_write_fpga_image(diva_os_xdi_adapter_t *a, byte *data,
dword length)
{
int ret;
@@ -865,12 +865,12 @@ static int diva_4bri_reset_adapter(PISDN_ADAPTER IoAdapter)
if (IoAdapter->Initialized) {
DBG_ERR(("A: A(%d) can't reset 4BRI adapter - please stop first",
IoAdapter->ANum))
- return (-1);
+ return (-1);
}
/*
- Forget all entities on all adapters
- */
+ Forget all entities on all adapters
+ */
for (i = 0; ((i < IoAdapter->tasks) && IoAdapter->QuadroList); i++) {
Slave = IoAdapter->QuadroList->QuadroAdapter[i];
Slave->e_count = 0;
@@ -908,7 +908,7 @@ static int diva_4bri_reset_adapter(PISDN_ADAPTER IoAdapter)
static int
diva_4bri_write_sdram_block(PISDN_ADAPTER IoAdapter,
dword address,
- const byte * data, dword length, dword limit)
+ const byte *data, dword length, dword limit)
{
byte __iomem *p = DIVA_OS_MEM_ATTACH_ADDRESS(IoAdapter);
byte __iomem *mem = p;
@@ -917,7 +917,7 @@ diva_4bri_write_sdram_block(PISDN_ADAPTER IoAdapter,
DIVA_OS_MEM_DETACH_ADDRESS(IoAdapter, p);
DBG_ERR(("A: A(%d) write 4BRI address=0x%08lx",
IoAdapter->ANum, address + length))
- return (-1);
+ return (-1);
}
mem += address;
@@ -939,14 +939,14 @@ diva_4bri_start_adapter(PISDN_ADAPTER IoAdapter,
byte __iomem *p;
/*
- start adapter
- */
+ start adapter
+ */
start_qBri_hardware(IoAdapter);
p = DIVA_OS_MEM_ATTACH_RAM(IoAdapter);
/*
- wait for signature in shared memory (max. 3 seconds)
- */
+ wait for signature in shared memory (max. 3 seconds)
+ */
signature = (volatile word __iomem *) (&p[0x1E]);
for (i = 0; i < 300; ++i) {
@@ -954,23 +954,23 @@ diva_4bri_start_adapter(PISDN_ADAPTER IoAdapter,
if (READ_WORD(&signature[0]) == 0x4447) {
DBG_TRC(("Protocol startup time %d.%02d seconds",
(i / 100), (i % 100)))
- started = 1;
+ started = 1;
break;
}
}
for (i = 1; i < IoAdapter->tasks; i++) {
IoAdapter->QuadroList->QuadroAdapter[i]->features =
- IoAdapter->features;
+ IoAdapter->features;
IoAdapter->QuadroList->QuadroAdapter[i]->a.
- protocol_capabilities = IoAdapter->features;
+ protocol_capabilities = IoAdapter->features;
}
if (!started) {
DBG_FTL(("%s: Adapter selftest failed, signature=%04x",
IoAdapter->Properties.Name,
READ_WORD(&signature[0])))
- DIVA_OS_MEM_DETACH_RAM(IoAdapter, p);
+ DIVA_OS_MEM_DETACH_RAM(IoAdapter, p);
(*(IoAdapter->trapFnc)) (IoAdapter);
IoAdapter->stop(IoAdapter);
return (-1);
@@ -985,9 +985,9 @@ diva_4bri_start_adapter(PISDN_ADAPTER IoAdapter,
if (check_qBri_interrupt(IoAdapter)) {
DBG_ERR(("A: A(%d) interrupt test failed",
IoAdapter->ANum))
- for (i = 0; i < IoAdapter->tasks; i++) {
- IoAdapter->QuadroList->QuadroAdapter[i]->Initialized = 0;
- }
+ for (i = 0; i < IoAdapter->tasks; i++) {
+ IoAdapter->QuadroList->QuadroAdapter[i]->Initialized = 0;
+ }
IoAdapter->stop(IoAdapter);
return (-1);
}
@@ -999,7 +999,7 @@ diva_4bri_start_adapter(PISDN_ADAPTER IoAdapter,
DBG_LOG(("A(%d) %s adapter successfully started",
IoAdapter->QuadroList->QuadroAdapter[i]->ANum,
(IoAdapter->tasks == 1) ? "BRI 2.0" : "4BRI"))
- diva_xdi_didd_register_adapter(IoAdapter->QuadroList->QuadroAdapter[i]->ANum);
+ diva_xdi_didd_register_adapter(IoAdapter->QuadroList->QuadroAdapter[i]->ANum);
IoAdapter->QuadroList->QuadroAdapter[i]->Properties.Features = (word) features;
}
@@ -1022,8 +1022,8 @@ static int check_qBri_interrupt(PISDN_ADAPTER IoAdapter)
WRITE_BYTE(&p[PLX9054_INTCSR], PLX9054_INT_ENABLE);
DIVA_OS_MEM_DETACH_RESET(IoAdapter, p);
/*
- interrupt test
- */
+ interrupt test
+ */
a->ReadyInt = 1;
a->ram_out(a, &PR_RAM->ReadyInt, 1);
@@ -1034,14 +1034,14 @@ static int check_qBri_interrupt(PISDN_ADAPTER IoAdapter)
dword volatile __iomem *qBriIrq;
byte __iomem *p;
/*
- Reset on-board interrupt register
- */
+ Reset on-board interrupt register
+ */
IoAdapter->IrqCount = 0;
p = DIVA_OS_MEM_ATTACH_CTLREG(IoAdapter);
qBriIrq = (dword volatile __iomem *) (&p[_4bri_is_rev_2_card
- (IoAdapter->
- cardType) ? (MQ2_BREG_IRQ_TEST)
- : (MQ_BREG_IRQ_TEST)]);
+ (IoAdapter->
+ cardType) ? (MQ2_BREG_IRQ_TEST)
+ : (MQ_BREG_IRQ_TEST)]);
WRITE_DWORD(qBriIrq, MQ_IRQ_REQ_OFF);
DIVA_OS_MEM_DETACH_CTLREG(IoAdapter, p);
@@ -1056,13 +1056,13 @@ static int check_qBri_interrupt(PISDN_ADAPTER IoAdapter)
#endif /* SUPPORT_INTERRUPT_TEST_ON_4BRI */
}
-static void diva_4bri_clear_interrupts(diva_os_xdi_adapter_t * a)
+static void diva_4bri_clear_interrupts(diva_os_xdi_adapter_t *a)
{
PISDN_ADAPTER IoAdapter = &a->xdi_adapter;
/*
- clear any pending interrupt
- */
+ clear any pending interrupt
+ */
IoAdapter->disIrq(IoAdapter);
IoAdapter->tst_irq(&IoAdapter->a);
@@ -1070,13 +1070,13 @@ static void diva_4bri_clear_interrupts(diva_os_xdi_adapter_t * a)
IoAdapter->tst_irq(&IoAdapter->a);
/*
- kill pending dpcs
- */
+ kill pending dpcs
+ */
diva_os_cancel_soft_isr(&IoAdapter->req_soft_isr);
diva_os_cancel_soft_isr(&IoAdapter->isr_soft_isr);
}
-static int diva_4bri_stop_adapter(diva_os_xdi_adapter_t * a)
+static int diva_4bri_stop_adapter(diva_os_xdi_adapter_t *a)
{
PISDN_ADAPTER IoAdapter = &a->xdi_adapter;
int i;
@@ -1088,7 +1088,7 @@ static int diva_4bri_stop_adapter(diva_os_xdi_adapter_t * a)
if (!IoAdapter->Initialized) {
DBG_ERR(("A: A(%d) can't stop PRI adapter - not running",
IoAdapter->ANum))
- return (-1); /* nothing to stop */
+ return (-1); /* nothing to stop */
}
for (i = 0; i < IoAdapter->tasks; i++) {
@@ -1096,8 +1096,8 @@ static int diva_4bri_stop_adapter(diva_os_xdi_adapter_t * a)
}
/*
- Disconnect Adapters from DIDD
- */
+ Disconnect Adapters from DIDD
+ */
for (i = 0; i < IoAdapter->tasks; i++) {
diva_xdi_didd_remove_adapter(IoAdapter->QuadroList->QuadroAdapter[i]->ANum);
}
@@ -1105,8 +1105,8 @@ static int diva_4bri_stop_adapter(diva_os_xdi_adapter_t * a)
i = 100;
/*
- Stop interrupts
- */
+ Stop interrupts
+ */
a->clear_interrupts_proc = diva_4bri_clear_interrupts;
IoAdapter->a.ReadyInt = 1;
IoAdapter->a.ram_inc(&IoAdapter->a, &PR_RAM->ReadyInt);
@@ -1119,12 +1119,12 @@ static int diva_4bri_stop_adapter(diva_os_xdi_adapter_t * a)
a->clear_interrupts_proc = NULL;
DBG_ERR(("A: A(%d) no final interrupt from 4BRI adapter",
IoAdapter->ANum))
- }
+ }
IoAdapter->a.ReadyInt = 0;
/*
- Stop and reset adapter
- */
+ Stop and reset adapter
+ */
IoAdapter->stop(IoAdapter);
return (0);