isdn: whitespace coding style cleanup
[linux-2.6-block.git] / drivers / isdn / hardware / eicon / diva.c
index ffa2afa77c2f199b8b2128d86d29597472f77694..d91dd580e9781bc73704d3ad41c009265e227320 100644 (file)
 
 PISDN_ADAPTER IoAdapters[MAX_ADAPTER];
 extern IDI_CALL Requests[MAX_ADAPTER];
-extern int create_adapter_proc(diva_os_xdi_adapter_t * a);
-extern void remove_adapter_proc(diva_os_xdi_adapter_t * a);
+extern int create_adapter_proc(diva_os_xdi_adapter_t *a);
+extern void remove_adapter_proc(diva_os_xdi_adapter_t *a);
 
-#define DivaIdiReqFunc(N) \
-static void DivaIdiRequest##N(ENTITY *e) \
-{ if ( IoAdapters[N] ) (* IoAdapters[N]->DIRequest)(IoAdapters[N], e) ; }
+#define DivaIdiReqFunc(N)                                              \
+       static void DivaIdiRequest##N(ENTITY *e)                        \
+       { if (IoAdapters[N]) (*IoAdapters[N]->DIRequest)(IoAdapters[N], e); }
 
 /*
 **  Create own 32 Adapters
@@ -91,44 +91,44 @@ typedef struct _diva_supported_cards_info {
 static diva_supported_cards_info_t divas_supported_cards[] = {
 #ifdef CONFIG_ISDN_DIVAS_PRIPCI
        /*
-          PRI Cards
-        */
+         PRI Cards
+       */
        {CARDTYPE_DIVASRV_P_30M_PCI, diva_pri_init_card},
        /*
-          PRI Rev.2 Cards
-        */
+         PRI Rev.2 Cards
+       */
        {CARDTYPE_DIVASRV_P_30M_V2_PCI, diva_pri_init_card},
        /*
-          PRI Rev.2 VoIP Cards
-        */
+         PRI Rev.2 VoIP Cards
+       */
        {CARDTYPE_DIVASRV_VOICE_P_30M_V2_PCI, diva_pri_init_card},
 #endif
 #ifdef CONFIG_ISDN_DIVAS_BRIPCI
        /*
-          4BRI Rev 1 Cards
-        */
+         4BRI Rev 1 Cards
+       */
        {CARDTYPE_DIVASRV_Q_8M_PCI, diva_4bri_init_card},
        {CARDTYPE_DIVASRV_VOICE_Q_8M_PCI, diva_4bri_init_card},
        /*
-          4BRI Rev 2 Cards
-        */
+         4BRI Rev 2 Cards
+       */
        {CARDTYPE_DIVASRV_Q_8M_V2_PCI, diva_4bri_init_card},
        {CARDTYPE_DIVASRV_VOICE_Q_8M_V2_PCI, diva_4bri_init_card},
        /*
-          4BRI Based BRI Rev 2 Cards
-        */
+         4BRI Based BRI Rev 2 Cards
+       */
        {CARDTYPE_DIVASRV_B_2M_V2_PCI, diva_4bri_init_card},
        {CARDTYPE_DIVASRV_B_2F_PCI, diva_4bri_init_card},
        {CARDTYPE_DIVASRV_VOICE_B_2M_V2_PCI, diva_4bri_init_card},
        /*
-          BRI
-        */
+         BRI
+       */
        {CARDTYPE_MAESTRA_PCI, diva_bri_init_card},
 #endif
 
        /*
-          EOL
-        */
+         EOL
+       */
        {-1}
 };
 
@@ -150,18 +150,18 @@ static int diva_find_free_adapters(int base, int nr)
        return (0);
 }
 
-static diva_os_xdi_adapter_t *diva_q_get_next(struct list_head * what)
+static diva_os_xdi_adapter_t *diva_q_get_next(struct list_head *what)
 {
        diva_os_xdi_adapter_t *a = NULL;
 
        if (what && (what->next != &adapter_queue))
                a = list_entry(what->next, diva_os_xdi_adapter_t, link);
 
-       return(a);
+       return (a);
 }
 
 /* --------------------------------------------------------------------------
-    Add card to the card list
+   Add card to the card list
    -------------------------------------------------------------------------- */
 void *diva_driver_add_card(void *pdev, unsigned long CardOrdinal)
 {
@@ -203,7 +203,7 @@ void *diva_driver_add_card(void *pdev, unsigned long CardOrdinal)
                                                 [CardOrdinal].Name,
                                                 pdiva->controller))
 
-                                       diva_os_enter_spin_lock(&adapter_lock, &old_irql, "add card");
+                                               diva_os_enter_spin_lock(&adapter_lock, &old_irql, "add card");
                                        pa = pdiva;
                                        for (j = 1; j < nr; j++) {      /* slave adapters, if any */
                                                pa = diva_q_get_next(&pa->link);
@@ -214,11 +214,11 @@ void *diva_driver_add_card(void *pdev, unsigned long CardOrdinal)
                                                        diva_os_leave_spin_lock(&adapter_lock, &old_irql, "add card");
                                                        DBG_LOG(("add slave adapter (%d)",
                                                                 pa->controller))
-                                                       create_adapter_proc(pa);        /* add adapter to proc file system */
+                                                               create_adapter_proc(pa);        /* add adapter to proc file system */
                                                        diva_os_enter_spin_lock(&adapter_lock, &old_irql, "add card");
                                                } else {
                                                        DBG_ERR(("slave adapter problem"))
-                                                       break;
+                                                               break;
                                                }
                                        }
 
@@ -230,10 +230,10 @@ void *diva_driver_add_card(void *pdev, unsigned long CardOrdinal)
                        diva_os_leave_spin_lock(&adapter_lock, &old_irql, "add card");
 
                        /*
-                          Not able to add adapter - remove it and return error
-                        */
+                         Not able to add adapter - remove it and return error
+                       */
                        DBG_ERR(("can not alloc request array"))
-                       diva_driver_remove_card(pdiva);
+                               diva_driver_remove_card(pdiva);
 
                        return NULL;
                }
@@ -243,7 +243,7 @@ void *diva_driver_add_card(void *pdev, unsigned long CardOrdinal)
 }
 
 /* --------------------------------------------------------------------------
-    Called on driver load, MAIN, main, DriverEntry
+   Called on driver load, MAIN, main, DriverEntry
    -------------------------------------------------------------------------- */
 int divasa_xdi_driver_entry(void)
 {
@@ -255,7 +255,7 @@ int divasa_xdi_driver_entry(void)
 }
 
 /* --------------------------------------------------------------------------
-    Remove adapter from list
+   Remove adapter from list
    -------------------------------------------------------------------------- */
 static diva_os_xdi_adapter_t *get_and_remove_from_queue(void)
 {
@@ -274,7 +274,7 @@ static diva_os_xdi_adapter_t *get_and_remove_from_queue(void)
 }
 
 /* --------------------------------------------------------------------------
-    Remove card from the card list
+   Remove card from the card list
    -------------------------------------------------------------------------- */
 void diva_driver_remove_card(void *pdiva)
 {
@@ -318,7 +318,7 @@ void diva_driver_remove_card(void *pdiva)
 }
 
 /* --------------------------------------------------------------------------
-    Create diva PCI adapter and init internal adapter structures
+   Create diva PCI adapter and init internal adapter structures
    -------------------------------------------------------------------------- */
 static void *divas_create_pci_card(int handle, void *pci_dev_handle)
 {
@@ -328,10 +328,10 @@ static void *divas_create_pci_card(int handle, void *pci_dev_handle)
 
        DBG_LOG(("found %d-%s", pI->CardOrdinal, CardProperties[pI->CardOrdinal].Name))
 
-       if (!(a = (diva_os_xdi_adapter_t *) diva_os_malloc(0, sizeof(*a)))) {
-               DBG_ERR(("A: can't alloc adapter"));
-               return NULL;
-       }
+               if (!(a = (diva_os_xdi_adapter_t *) diva_os_malloc(0, sizeof(*a)))) {
+                       DBG_ERR(("A: can't alloc adapter"));
+                       return NULL;
+               }
 
        memset(a, 0x00, sizeof(*a));
 
@@ -344,9 +344,9 @@ static void *divas_create_pci_card(int handle, void *pci_dev_handle)
        a->resources.pci.hdev = pci_dev_handle;
 
        /*
-          Add master adapter first, so slave adapters will receive higher
-          numbers as master adapter
-        */
+         Add master adapter first, so slave adapters will receive higher
+         numbers as master adapter
+       */
        diva_os_enter_spin_lock(&adapter_lock, &old_irql, "found_pci_card");
        list_add_tail(&a->link, &adapter_queue);
        diva_os_leave_spin_lock(&adapter_lock, &old_irql, "found_pci_card");
@@ -364,7 +364,7 @@ static void *divas_create_pci_card(int handle, void *pci_dev_handle)
 }
 
 /* --------------------------------------------------------------------------
-    Called on driver unload FINIT, finit, Unload
+   Called on driver unload FINIT, finit, Unload
    -------------------------------------------------------------------------- */
 void divasa_xdi_driver_unload(void)
 {
@@ -398,11 +398,11 @@ void *diva_xdi_open_adapter(void *os_handle, const void __user *src,
        if (length < sizeof(diva_xdi_um_cfg_cmd_t)) {
                DBG_ERR(("A: A(?) open, msg too small (%d < %d)",
                         length, sizeof(diva_xdi_um_cfg_cmd_t)))
-               return NULL;
+                       return NULL;
        }
        if ((*cp_fn) (os_handle, &msg, src, sizeof(msg)) <= 0) {
                DBG_ERR(("A: A(?) open, write error"))
-               return NULL;
+                       return NULL;
        }
        diva_os_enter_spin_lock(&adapter_lock, &old_irql, "open_adapter");
        list_for_each(tmp, &adapter_queue) {
@@ -415,7 +415,7 @@ void *diva_xdi_open_adapter(void *os_handle, const void __user *src,
 
        if (!a) {
                DBG_ERR(("A: A(%d) open, adapter not found", msg.adapter))
-       }
+                       }
 
        return (a);
 }
@@ -443,19 +443,19 @@ diva_xdi_write(void *adapter, void *os_handle, const void __user *src,
 
        if (a->xdi_mbox.status & DIVA_XDI_MBOX_BUSY) {
                DBG_ERR(("A: A(%d) write, mbox busy", a->controller))
-               return (-1);
+                       return (-1);
        }
 
        if (length < sizeof(diva_xdi_um_cfg_cmd_t)) {
                DBG_ERR(("A: A(%d) write, message too small (%d < %d)",
                         a->controller, length,
                         sizeof(diva_xdi_um_cfg_cmd_t)))
-               return (-3);
+                       return (-3);
        }
 
        if (!(data = diva_os_malloc(0, length))) {
                DBG_ERR(("A: A(%d) write, ENOMEM", a->controller))
-               return (-2);
+                       return (-2);
        }
 
        length = (*cp_fn) (os_handle, data, src, length);
@@ -467,7 +467,7 @@ diva_xdi_write(void *adapter, void *os_handle, const void __user *src,
        } else {
                DBG_ERR(("A: A(%d) write error (%d)", a->controller,
                         length))
-       }
+                       }
 
        diva_os_free(0, data);
 
@@ -486,23 +486,23 @@ diva_xdi_read(void *adapter, void *os_handle, void __user *dst,
 
        if (!(a->xdi_mbox.status & DIVA_XDI_MBOX_BUSY)) {
                DBG_ERR(("A: A(%d) rx mbox empty", a->controller))
-               return (-1);
+                       return (-1);
        }
        if (!a->xdi_mbox.data) {
                a->xdi_mbox.status &= ~DIVA_XDI_MBOX_BUSY;
                DBG_ERR(("A: A(%d) rx ENOMEM", a->controller))
-               return (-2);
+                       return (-2);
        }
 
        if (max_length < a->xdi_mbox.data_length) {
                DBG_ERR(("A: A(%d) rx buffer too short(%d < %d)",
                         a->controller, max_length,
                         a->xdi_mbox.data_length))
-               return (-3);
+                       return (-3);
        }
 
        ret = (*cp_fn) (os_handle, dst, a->xdi_mbox.data,
-                     a->xdi_mbox.data_length);
+                       a->xdi_mbox.data_length);
        if (ret > 0) {
                diva_os_free(0, a->xdi_mbox.data);
                a->xdi_mbox.data = NULL;
@@ -515,12 +515,11 @@ diva_xdi_read(void *adapter, void *os_handle, void __user *dst,
 
 irqreturn_t diva_os_irq_wrapper(int irq, void *context)
 {
-       diva_os_xdi_adapter_t *a = (diva_os_xdi_adapter_t *) context;
+       diva_os_xdi_adapter_t *a = context;
        diva_xdi_clear_interrupts_proc_t clear_int_proc;
 
-       if (!a || !a->xdi_adapter.diva_isr_handler) {
+       if (!a || !a->xdi_adapter.diva_isr_handler)
                return IRQ_NONE;
-       }
 
        if ((clear_int_proc = a->clear_interrupts_proc)) {
                (*clear_int_proc) (a);
@@ -578,33 +577,33 @@ void diva_xdi_display_adapter_features(int card)
        features = IoAdapters[card]->Properties.Features;
 
        DBG_LOG(("FEATURES FOR ADAPTER: %d", card + 1))
-       DBG_LOG((" DI_FAX3          :  %s",
-                    (features & DI_FAX3) ? "Y" : "N"))
-       DBG_LOG((" DI_MODEM         :  %s",
-                    (features & DI_MODEM) ? "Y" : "N"))
-       DBG_LOG((" DI_POST          :  %s",
-                    (features & DI_POST) ? "Y" : "N"))
-       DBG_LOG((" DI_V110          :  %s",
-                    (features & DI_V110) ? "Y" : "N"))
-       DBG_LOG((" DI_V120          :  %s",
-                    (features & DI_V120) ? "Y" : "N"))
-       DBG_LOG((" DI_POTS          :  %s",
-                    (features & DI_POTS) ? "Y" : "N"))
-       DBG_LOG((" DI_CODEC         :  %s",
-                    (features & DI_CODEC) ? "Y" : "N"))
-       DBG_LOG((" DI_MANAGE        :  %s",
-                    (features & DI_MANAGE) ? "Y" : "N"))
-       DBG_LOG((" DI_V_42          :  %s",
-                    (features & DI_V_42) ? "Y" : "N"))
-       DBG_LOG((" DI_EXTD_FAX      :  %s",
-                    (features & DI_EXTD_FAX) ? "Y" : "N"))
-       DBG_LOG((" DI_AT_PARSER     :  %s",
-                    (features & DI_AT_PARSER) ? "Y" : "N"))
-       DBG_LOG((" DI_VOICE_OVER_IP :  %s",
-                    (features & DI_VOICE_OVER_IP) ? "Y" : "N"))
-}
+               DBG_LOG((" DI_FAX3          :  %s",
+                        (features & DI_FAX3) ? "Y" : "N"))
+               DBG_LOG((" DI_MODEM         :  %s",
+                        (features & DI_MODEM) ? "Y" : "N"))
+               DBG_LOG((" DI_POST          :  %s",
+                        (features & DI_POST) ? "Y" : "N"))
+               DBG_LOG((" DI_V110          :  %s",
+                        (features & DI_V110) ? "Y" : "N"))
+               DBG_LOG((" DI_V120          :  %s",
+                        (features & DI_V120) ? "Y" : "N"))
+               DBG_LOG((" DI_POTS          :  %s",
+                        (features & DI_POTS) ? "Y" : "N"))
+               DBG_LOG((" DI_CODEC         :  %s",
+                        (features & DI_CODEC) ? "Y" : "N"))
+               DBG_LOG((" DI_MANAGE        :  %s",
+                        (features & DI_MANAGE) ? "Y" : "N"))
+               DBG_LOG((" DI_V_42          :  %s",
+                        (features & DI_V_42) ? "Y" : "N"))
+               DBG_LOG((" DI_EXTD_FAX      :  %s",
+                        (features & DI_EXTD_FAX) ? "Y" : "N"))
+               DBG_LOG((" DI_AT_PARSER     :  %s",
+                        (features & DI_AT_PARSER) ? "Y" : "N"))
+               DBG_LOG((" DI_VOICE_OVER_IP :  %s",
+                        (features & DI_VOICE_OVER_IP) ? "Y" : "N"))
+               }
 
-void diva_add_slave_adapter(diva_os_xdi_adapter_t * a)
+void diva_add_slave_adapter(diva_os_xdi_adapter_t *a)
 {
        diva_os_spin_lock_magic_t old_irql;
 
@@ -613,7 +612,7 @@ void diva_add_slave_adapter(diva_os_xdi_adapter_t * a)
        diva_os_leave_spin_lock(&adapter_lock, &old_irql, "add_slave");
 }
 
-int diva_card_read_xlog(diva_os_xdi_adapter_t * a)
+int diva_card_read_xlog(diva_os_xdi_adapter_t *a)
 {
        diva_get_xlog_t *req;
        byte *data;