summaryrefslogtreecommitdiffstats
path: root/drivers/isdn/hardware/avm/avmcard.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/isdn/hardware/avm/avmcard.h')
-rw-r--r--drivers/isdn/hardware/avm/avmcard.h286
1 files changed, 143 insertions, 143 deletions
diff --git a/drivers/isdn/hardware/avm/avmcard.h b/drivers/isdn/hardware/avm/avmcard.h
index a70e8854461d..c95712dbfa9f 100644
--- a/drivers/isdn/hardware/avm/avmcard.h
+++ b/drivers/isdn/hardware/avm/avmcard.h
@@ -44,16 +44,16 @@ enum avmcardtype {
};
typedef struct avmcard_dmabuf {
- long size;
- u8 *dmabuf;
- dma_addr_t dmaaddr;
+ long size;
+ u8 *dmabuf;
+ dma_addr_t dmaaddr;
} avmcard_dmabuf;
typedef struct avmcard_dmainfo {
u32 recvlen;
- avmcard_dmabuf recvbuf;
+ avmcard_dmabuf recvbuf;
- avmcard_dmabuf sendbuf;
+ avmcard_dmabuf sendbuf;
struct sk_buff_head send_queue;
struct pci_dev *pcidev;
@@ -61,22 +61,22 @@ typedef struct avmcard_dmainfo {
typedef struct avmctrl_info {
char cardname[32];
-
+
int versionlen;
char versionbuf[1024];
char *version[AVM_MAXVERSION];
-
+
char infobuf[128]; /* for function procinfo */
-
+
struct avmcard *card;
struct capi_ctr capi_ctrl;
-
+
struct list_head ncci_head;
} avmctrl_info;
typedef struct avmcard {
char name[32];
-
+
spinlock_t lock;
unsigned int port;
unsigned irq;
@@ -103,95 +103,95 @@ typedef struct avmcard {
extern int b1_irq_table[16];
/*
- * LLI Messages to the ISDN-ControllerISDN Controller
+ * LLI Messages to the ISDN-ControllerISDN Controller
*/
#define SEND_POLL 0x72 /*
- * after load <- RECEIVE_POLL
+ * after load <- RECEIVE_POLL
*/
#define SEND_INIT 0x11 /*
- * first message <- RECEIVE_INIT
- * int32 NumApplications int32
- * NumNCCIs int32 BoardNumber
+ * first message <- RECEIVE_INIT
+ * int32 NumApplications int32
+ * NumNCCIs int32 BoardNumber
*/
#define SEND_REGISTER 0x12 /*
- * register an application int32
- * ApplIDId int32 NumMessages
- * int32 NumB3Connections int32
- * NumB3Blocks int32 B3Size
- *
- * AnzB3Connection != 0 &&
- * AnzB3Blocks >= 1 && B3Size >= 1
+ * register an application int32
+ * ApplIDId int32 NumMessages
+ * int32 NumB3Connections int32
+ * NumB3Blocks int32 B3Size
+ *
+ * AnzB3Connection != 0 &&
+ * AnzB3Blocks >= 1 && B3Size >= 1
*/
#define SEND_RELEASE 0x14 /*
- * deregister an application int32
- * ApplID
+ * deregister an application int32
+ * ApplID
*/
#define SEND_MESSAGE 0x15 /*
- * send capi-message int32 length
- * capi-data ...
+ * send capi-message int32 length
+ * capi-data ...
*/
#define SEND_DATA_B3_REQ 0x13 /*
- * send capi-data-message int32
- * MsgLength capi-data ... int32
- * B3Length data ....
+ * send capi-data-message int32
+ * MsgLength capi-data ... int32
+ * B3Length data ....
*/
#define SEND_CONFIG 0x21 /*
- */
+ */
#define SEND_POLLACK 0x73 /* T1 Watchdog */
/*
- * LLI Messages from the ISDN-ControllerISDN Controller
+ * LLI Messages from the ISDN-ControllerISDN Controller
*/
#define RECEIVE_POLL 0x32 /*
- * <- after SEND_POLL
+ * <- after SEND_POLL
*/
#define RECEIVE_INIT 0x27 /*
- * <- after SEND_INIT int32 length
- * byte total length b1struct board
- * driver revision b1struct card
- * type b1struct reserved b1struct
- * serial number b1struct driver
- * capability b1struct d-channel
- * protocol b1struct CAPI-2.0
- * profile b1struct capi version
+ * <- after SEND_INIT int32 length
+ * byte total length b1struct board
+ * driver revision b1struct card
+ * type b1struct reserved b1struct
+ * serial number b1struct driver
+ * capability b1struct d-channel
+ * protocol b1struct CAPI-2.0
+ * profile b1struct capi version
*/
#define RECEIVE_MESSAGE 0x21 /*
- * <- after SEND_MESSAGE int32
- * AppllID int32 Length capi-data
- * ....
+ * <- after SEND_MESSAGE int32
+ * AppllID int32 Length capi-data
+ * ....
*/
#define RECEIVE_DATA_B3_IND 0x22 /*
- * received data int32 AppllID
- * int32 Length capi-data ...
- * int32 B3Length data ...
+ * received data int32 AppllID
+ * int32 Length capi-data ...
+ * int32 B3Length data ...
*/
#define RECEIVE_START 0x23 /*
- * Handshake
+ * Handshake
*/
#define RECEIVE_STOP 0x24 /*
- * Handshake
+ * Handshake
*/
#define RECEIVE_NEW_NCCI 0x25 /*
- * int32 AppllID int32 NCCI int32
- * WindowSize
+ * int32 AppllID int32 NCCI int32
+ * WindowSize
*/
#define RECEIVE_FREE_NCCI 0x26 /*
- * int32 AppllID int32 NCCI
+ * int32 AppllID int32 NCCI
*/
#define RECEIVE_RELEASE 0x26 /*
- * int32 AppllID int32 0xffffffff
+ * int32 AppllID int32 0xffffffff
*/
#define RECEIVE_TASK_READY 0x31 /*
- * int32 tasknr
- * int32 Length Taskname ...
+ * int32 tasknr
+ * int32 Length Taskname ...
*/
#define RECEIVE_DEBUGMSG 0x71 /*
- * int32 Length message
- *
+ * int32 Length message
+ *
*/
#define RECEIVE_POLLDWORD 0x75 /* t1pci in dword mode */
@@ -264,7 +264,7 @@ static inline void b1_put_byte(unsigned int base, unsigned char val)
static inline int b1_save_put_byte(unsigned int base, unsigned char val)
{
unsigned long stop = jiffies + 2 * HZ;
- while (!b1_tx_empty(base) && time_before(jiffies,stop));
+ while (!b1_tx_empty(base) && time_before(jiffies, stop));
if (!b1_tx_empty(base)) return -1;
b1outp(base, B1_WRITE, val);
return 0;
@@ -298,21 +298,21 @@ static inline void b1_put_slice(unsigned int base,
}
static void b1_wr_reg(unsigned int base,
- unsigned int reg,
+ unsigned int reg,
unsigned int value)
{
b1_put_byte(base, WRITE_REGISTER);
- b1_put_word(base, reg);
- b1_put_word(base, value);
+ b1_put_word(base, reg);
+ b1_put_word(base, value);
}
static inline unsigned int b1_rd_reg(unsigned int base,
- unsigned int reg)
+ unsigned int reg)
{
b1_put_byte(base, READ_REGISTER);
- b1_put_word(base, reg);
- return b1_get_word(base);
-
+ b1_put_word(base, reg);
+ return b1_get_word(base);
+
}
static inline void b1_reset(unsigned int base)
@@ -338,13 +338,13 @@ static inline void b1_set_test_bit(unsigned int base,
enum avmcardtype cardtype,
int onoff)
{
- b1_wr_reg(base, B1_STAT0(cardtype), onoff ? 0x21 : 0x20);
+ b1_wr_reg(base, B1_STAT0(cardtype), onoff ? 0x21 : 0x20);
}
static inline int b1_get_test_bit(unsigned int base,
- enum avmcardtype cardtype)
+ enum avmcardtype cardtype)
{
- return (b1_rd_reg(base, B1_STAT0(cardtype)) & 0x01) != 0;
+ return (b1_rd_reg(base, B1_STAT0(cardtype)) & 0x01) != 0;
}
/* ---------------------------------------------------------------- */
@@ -391,7 +391,7 @@ static inline void t1outp(unsigned int base,
}
static inline unsigned char t1inp(unsigned int base,
- unsigned short offset)
+ unsigned short offset)
{
return inb(base + offset);
}
@@ -415,42 +415,42 @@ static inline unsigned int t1_get_slice(unsigned int base,
#endif
len = i = b1_get_word(base);
- if (t1_isfastlink(base)) {
+ if (t1_isfastlink(base)) {
int status;
while (i > 0) {
- status = t1_fifostatus(base) & (T1F_IREADY|T1F_IHALF);
+ status = t1_fifostatus(base) & (T1F_IREADY | T1F_IHALF);
if (i >= FIFO_INPBSIZE) status |= T1F_IFULL;
switch (status) {
- case T1F_IREADY|T1F_IHALF|T1F_IFULL:
- insb(base+B1_READ, dp, FIFO_INPBSIZE);
- dp += FIFO_INPBSIZE;
- i -= FIFO_INPBSIZE;
+ case T1F_IREADY | T1F_IHALF | T1F_IFULL:
+ insb(base + B1_READ, dp, FIFO_INPBSIZE);
+ dp += FIFO_INPBSIZE;
+ i -= FIFO_INPBSIZE;
#ifdef FASTLINK_DEBUG
- wcnt += FIFO_INPBSIZE;
+ wcnt += FIFO_INPBSIZE;
#endif
- break;
- case T1F_IREADY|T1F_IHALF:
- insb(base+B1_READ,dp, i);
+ break;
+ case T1F_IREADY | T1F_IHALF:
+ insb(base + B1_READ, dp, i);
#ifdef FASTLINK_DEBUG
- wcnt += i;
+ wcnt += i;
#endif
- dp += i;
- i = 0;
- break;
- default:
- *dp++ = b1_get_byte(base);
- i--;
+ dp += i;
+ i = 0;
+ break;
+ default:
+ *dp++ = b1_get_byte(base);
+ i--;
#ifdef FASTLINK_DEBUG
- bcnt++;
+ bcnt++;
#endif
- break;
+ break;
}
- }
+ }
#ifdef FASTLINK_DEBUG
- if (wcnt)
- printk(KERN_DEBUG "b1lli(0x%x): get_slice l=%d w=%d b=%d\n",
- base, len, wcnt, bcnt);
+ if (wcnt)
+ printk(KERN_DEBUG "b1lli(0x%x): get_slice l=%d w=%d b=%d\n",
+ base, len, wcnt, bcnt);
#endif
} else {
while (i-- > 0)
@@ -464,26 +464,26 @@ static inline void t1_put_slice(unsigned int base,
{
unsigned i = len;
b1_put_word(base, i);
- if (t1_isfastlink(base)) {
+ if (t1_isfastlink(base)) {
int status;
while (i > 0) {
- status = t1_fifostatus(base) & (T1F_OREADY|T1F_OHALF);
+ status = t1_fifostatus(base) & (T1F_OREADY | T1F_OHALF);
if (i >= FIFO_OUTBSIZE) status |= T1F_OEMPTY;
switch (status) {
- case T1F_OREADY|T1F_OHALF|T1F_OEMPTY:
- outsb(base+B1_WRITE, dp, FIFO_OUTBSIZE);
- dp += FIFO_OUTBSIZE;
- i -= FIFO_OUTBSIZE;
- break;
- case T1F_OREADY|T1F_OHALF:
- outsb(base+B1_WRITE, dp, i);
- dp += i;
- i = 0;
- break;
- default:
- b1_put_byte(base, *dp++);
- i--;
- break;
+ case T1F_OREADY | T1F_OHALF | T1F_OEMPTY:
+ outsb(base + B1_WRITE, dp, FIFO_OUTBSIZE);
+ dp += FIFO_OUTBSIZE;
+ i -= FIFO_OUTBSIZE;
+ break;
+ case T1F_OREADY | T1F_OHALF:
+ outsb(base + B1_WRITE, dp, i);
+ dp += i;
+ i = 0;
+ break;
+ default:
+ b1_put_byte(base, *dp++);
+ i--;
+ break;
}
}
} else {
@@ -494,18 +494,18 @@ static inline void t1_put_slice(unsigned int base,
static inline void t1_disable_irq(unsigned int base)
{
- t1outp(base, T1_IRQMASTER, 0x00);
+ t1outp(base, T1_IRQMASTER, 0x00);
}
static inline void t1_reset(unsigned int base)
{
- /* reset T1 Controller */
- b1_reset(base);
- /* disable irq on HEMA */
- t1outp(base, B1_INSTAT, 0x00);
- t1outp(base, B1_OUTSTAT, 0x00);
- t1outp(base, T1_IRQMASTER, 0x00);
- /* reset HEMA board configuration */
+ /* reset T1 Controller */
+ b1_reset(base);
+ /* disable irq on HEMA */
+ t1outp(base, B1_INSTAT, 0x00);
+ t1outp(base, B1_OUTSTAT, 0x00);
+ t1outp(base, T1_IRQMASTER, 0x00);
+ /* reset HEMA board configuration */
t1outp(base, T1_RESETBOARD, 0xf);
}
@@ -513,29 +513,29 @@ static inline void b1_setinterrupt(unsigned int base, unsigned irq,
enum avmcardtype cardtype)
{
switch (cardtype) {
- case avm_t1isa:
- t1outp(base, B1_INSTAT, 0x00);
- t1outp(base, B1_INSTAT, 0x02);
- t1outp(base, T1_IRQMASTER, 0x08);
- break;
- case avm_b1isa:
- b1outp(base, B1_INSTAT, 0x00);
- b1outp(base, B1_RESET, b1_irq_table[irq]);
- b1outp(base, B1_INSTAT, 0x02);
- break;
- default:
- case avm_m1:
- case avm_m2:
- case avm_b1pci:
- b1outp(base, B1_INSTAT, 0x00);
- b1outp(base, B1_RESET, 0xf0);
- b1outp(base, B1_INSTAT, 0x02);
- break;
- case avm_c4:
- case avm_t1pci:
- b1outp(base, B1_RESET, 0xf0);
- break;
- }
+ case avm_t1isa:
+ t1outp(base, B1_INSTAT, 0x00);
+ t1outp(base, B1_INSTAT, 0x02);
+ t1outp(base, T1_IRQMASTER, 0x08);
+ break;
+ case avm_b1isa:
+ b1outp(base, B1_INSTAT, 0x00);
+ b1outp(base, B1_RESET, b1_irq_table[irq]);
+ b1outp(base, B1_INSTAT, 0x02);
+ break;
+ default:
+ case avm_m1:
+ case avm_m2:
+ case avm_b1pci:
+ b1outp(base, B1_INSTAT, 0x00);
+ b1outp(base, B1_RESET, 0xf0);
+ b1outp(base, B1_INSTAT, 0x02);
+ break;
+ case avm_c4:
+ case avm_t1pci:
+ b1outp(base, B1_RESET, 0xf0);
+ break;
+ }
}
/* b1.c */
@@ -543,14 +543,14 @@ avmcard *b1_alloc_card(int nr_controllers);
void b1_free_card(avmcard *card);
int b1_detect(unsigned int base, enum avmcardtype cardtype);
void b1_getrevision(avmcard *card);
-int b1_load_t4file(avmcard *card, capiloaddatapart * t4file);
-int b1_load_config(avmcard *card, capiloaddatapart * config);
+int b1_load_t4file(avmcard *card, capiloaddatapart *t4file);
+int b1_load_config(avmcard *card, capiloaddatapart *config);
int b1_loaded(avmcard *card);
int b1_load_firmware(struct capi_ctr *ctrl, capiloaddata *data);
void b1_reset_ctr(struct capi_ctr *ctrl);
void b1_register_appl(struct capi_ctr *ctrl, u16 appl,
- capi_register_params *rp);
+ capi_register_params *rp);
void b1_release_appl(struct capi_ctr *ctrl, u16 appl);
u16 b1_send_message(struct capi_ctr *ctrl, struct sk_buff *skb);
void b1_parse_version(avmctrl_info *card);
@@ -572,8 +572,8 @@ int b1dma_load_firmware(struct capi_ctr *ctrl, capiloaddata *data);
void b1dma_reset_ctr(struct capi_ctr *ctrl);
void b1dma_remove_ctr(struct capi_ctr *ctrl);
void b1dma_register_appl(struct capi_ctr *ctrl,
- u16 appl,
- capi_register_params *rp);
+ u16 appl,
+ capi_register_params *rp);
void b1dma_release_appl(struct capi_ctr *ctrl, u16 appl);
u16 b1dma_send_message(struct capi_ctr *ctrl, struct sk_buff *skb);
extern const struct file_operations b1dmactl_proc_fops;
OpenPOWER on IntegriCloud