Commit 3acd2f2c authored by Kai Germaschewski's avatar Kai Germaschewski

ISDN cleanup: drivers/isdn/hardware/avm s/__u{32,16,8}/u{32,16,8}/

parent 248c1097
...@@ -41,12 +41,12 @@ enum avmcardtype { ...@@ -41,12 +41,12 @@ enum avmcardtype {
typedef struct avmcard_dmabuf { typedef struct avmcard_dmabuf {
long size; long size;
__u8 *dmabuf; u8 *dmabuf;
dma_addr_t dmaaddr; dma_addr_t dmaaddr;
} avmcard_dmabuf; } avmcard_dmabuf;
typedef struct avmcard_dmainfo { typedef struct avmcard_dmainfo {
__u32 recvlen; u32 recvlen;
avmcard_dmabuf recvbuf; avmcard_dmabuf recvbuf;
avmcard_dmabuf sendbuf; avmcard_dmabuf sendbuf;
...@@ -71,7 +71,7 @@ typedef struct avmcard { ...@@ -71,7 +71,7 @@ typedef struct avmcard {
int interrupt; int interrupt;
void *mbase; void *mbase;
volatile __u32 csr; volatile u32 csr;
avmcard_dmainfo *dma; avmcard_dmainfo *dma;
struct avmctrl_info { struct avmctrl_info {
...@@ -542,9 +542,9 @@ int b1_loaded(avmcard *card); ...@@ -542,9 +542,9 @@ int b1_loaded(avmcard *card);
int b1_load_firmware(struct capi_ctr *ctrl, capiloaddata *data); int b1_load_firmware(struct capi_ctr *ctrl, capiloaddata *data);
void b1_reset_ctr(struct capi_ctr *ctrl); void b1_reset_ctr(struct capi_ctr *ctrl);
void b1_register_appl(struct capi_ctr *ctrl, __u16 appl, 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); void b1_release_appl(struct capi_ctr *ctrl, u16 appl);
void b1_send_message(struct capi_ctr *ctrl, struct sk_buff *skb); void b1_send_message(struct capi_ctr *ctrl, struct sk_buff *skb);
void b1_parse_version(avmctrl_info *card); void b1_parse_version(avmctrl_info *card);
void b1_handle_interrupt(avmcard * card); void b1_handle_interrupt(avmcard * card);
...@@ -567,9 +567,9 @@ int b1dma_load_firmware(struct capi_ctr *ctrl, capiloaddata *data); ...@@ -567,9 +567,9 @@ int b1dma_load_firmware(struct capi_ctr *ctrl, capiloaddata *data);
void b1dma_reset_ctr(struct capi_ctr *ctrl); void b1dma_reset_ctr(struct capi_ctr *ctrl);
void b1dma_remove_ctr(struct capi_ctr *ctrl); void b1dma_remove_ctr(struct capi_ctr *ctrl);
void b1dma_register_appl(struct capi_ctr *ctrl, void b1dma_register_appl(struct capi_ctr *ctrl,
__u16 appl, u16 appl,
capi_register_params *rp); capi_register_params *rp);
void b1dma_release_appl(struct capi_ctr *ctrl, __u16 appl); void b1dma_release_appl(struct capi_ctr *ctrl, u16 appl);
void b1dma_send_message(struct capi_ctr *ctrl, struct sk_buff *skb); void b1dma_send_message(struct capi_ctr *ctrl, struct sk_buff *skb);
int b1dmactl_read_proc(char *page, char **start, off_t off, int b1dmactl_read_proc(char *page, char **start, off_t off,
int count, int *eof, struct capi_ctr *ctrl); int count, int *eof, struct capi_ctr *ctrl);
......
...@@ -297,7 +297,7 @@ void b1_reset_ctr(struct capi_ctr *ctrl) ...@@ -297,7 +297,7 @@ void b1_reset_ctr(struct capi_ctr *ctrl)
} }
void b1_register_appl(struct capi_ctr *ctrl, void b1_register_appl(struct capi_ctr *ctrl,
__u16 appl, u16 appl,
capi_register_params *rp) capi_register_params *rp)
{ {
avmctrl_info *cinfo = (avmctrl_info *)(ctrl->driverdata); avmctrl_info *cinfo = (avmctrl_info *)(ctrl->driverdata);
...@@ -323,7 +323,7 @@ void b1_register_appl(struct capi_ctr *ctrl, ...@@ -323,7 +323,7 @@ void b1_register_appl(struct capi_ctr *ctrl,
ctrl->appl_registered(ctrl, appl); ctrl->appl_registered(ctrl, appl);
} }
void b1_release_appl(struct capi_ctr *ctrl, __u16 appl) void b1_release_appl(struct capi_ctr *ctrl, u16 appl)
{ {
avmctrl_info *cinfo = (avmctrl_info *)(ctrl->driverdata); avmctrl_info *cinfo = (avmctrl_info *)(ctrl->driverdata);
avmcard *card = cinfo->card; avmcard *card = cinfo->card;
...@@ -343,14 +343,14 @@ void b1_send_message(struct capi_ctr *ctrl, struct sk_buff *skb) ...@@ -343,14 +343,14 @@ void b1_send_message(struct capi_ctr *ctrl, struct sk_buff *skb)
avmcard *card = cinfo->card; avmcard *card = cinfo->card;
unsigned int port = card->port; unsigned int port = card->port;
unsigned long flags; unsigned long flags;
__u16 len = CAPIMSG_LEN(skb->data); u16 len = CAPIMSG_LEN(skb->data);
__u8 cmd = CAPIMSG_COMMAND(skb->data); u8 cmd = CAPIMSG_COMMAND(skb->data);
__u8 subcmd = CAPIMSG_SUBCOMMAND(skb->data); u8 subcmd = CAPIMSG_SUBCOMMAND(skb->data);
save_flags(flags); save_flags(flags);
cli(); cli();
if (CAPICMD(cmd, subcmd) == CAPI_DATA_B3_REQ) { if (CAPICMD(cmd, subcmd) == CAPI_DATA_B3_REQ) {
__u16 dlen = CAPIMSG_DATALEN(skb->data); u16 dlen = CAPIMSG_DATALEN(skb->data);
b1_put_byte(port, SEND_DATA_B3_REQ); b1_put_byte(port, SEND_DATA_B3_REQ);
b1_put_slice(port, skb->data, len); b1_put_slice(port, skb->data, len);
b1_put_slice(port, skb->data + len, dlen); b1_put_slice(port, skb->data + len, dlen);
...@@ -369,8 +369,8 @@ void b1_parse_version(avmctrl_info *cinfo) ...@@ -369,8 +369,8 @@ void b1_parse_version(avmctrl_info *cinfo)
struct capi_ctr *ctrl = cinfo->capi_ctrl; struct capi_ctr *ctrl = cinfo->capi_ctrl;
avmcard *card = cinfo->card; avmcard *card = cinfo->card;
capi_profile *profp; capi_profile *profp;
__u8 *dversion; u8 *dversion;
__u8 flag; u8 flag;
int i, j; int i, j;
for (j = 0; j < AVM_MAXVERSION; j++) for (j = 0; j < AVM_MAXVERSION; j++)
...@@ -394,7 +394,7 @@ void b1_parse_version(avmctrl_info *cinfo) ...@@ -394,7 +394,7 @@ void b1_parse_version(avmctrl_info *cinfo)
profp = &ctrl->profile; profp = &ctrl->profile;
flag = ((__u8 *)(profp->manu))[1]; flag = ((u8 *)(profp->manu))[1];
switch (flag) { switch (flag) {
case 0: if (cinfo->version[VER_CARDTYPE]) case 0: if (cinfo->version[VER_CARDTYPE])
strcpy(cinfo->cardname, cinfo->version[VER_CARDTYPE]); strcpy(cinfo->cardname, cinfo->version[VER_CARDTYPE]);
...@@ -410,7 +410,7 @@ void b1_parse_version(avmctrl_info *cinfo) ...@@ -410,7 +410,7 @@ void b1_parse_version(avmctrl_info *cinfo)
printk(KERN_NOTICE "%s: card %d \"%s\" ready.\n", printk(KERN_NOTICE "%s: card %d \"%s\" ready.\n",
card->name, ctrl->cnr, cinfo->cardname); card->name, ctrl->cnr, cinfo->cardname);
flag = ((__u8 *)(profp->manu))[3]; flag = ((u8 *)(profp->manu))[3];
if (flag) if (flag)
printk(KERN_NOTICE "%s: card %d Protocol:%s%s%s%s%s%s%s\n", printk(KERN_NOTICE "%s: card %d Protocol:%s%s%s%s%s%s%s\n",
card->name, card->name,
...@@ -424,7 +424,7 @@ void b1_parse_version(avmctrl_info *cinfo) ...@@ -424,7 +424,7 @@ void b1_parse_version(avmctrl_info *cinfo)
(flag & 0x40) ? " 1TR6" : "" (flag & 0x40) ? " 1TR6" : ""
); );
flag = ((__u8 *)(profp->manu))[5]; flag = ((u8 *)(profp->manu))[5];
if (flag) if (flag)
printk(KERN_NOTICE "%s: card %d Linetype:%s%s%s%s\n", printk(KERN_NOTICE "%s: card %d Linetype:%s%s%s%s\n",
card->name, card->name,
...@@ -574,7 +574,7 @@ int b1ctl_read_proc(char *page, char **start, off_t off, ...@@ -574,7 +574,7 @@ int b1ctl_read_proc(char *page, char **start, off_t off,
{ {
avmctrl_info *cinfo = (avmctrl_info *)(ctrl->driverdata); avmctrl_info *cinfo = (avmctrl_info *)(ctrl->driverdata);
avmcard *card = cinfo->card; avmcard *card = cinfo->card;
__u8 flag; u8 flag;
int len = 0; int len = 0;
char *s; char *s;
...@@ -604,7 +604,7 @@ int b1ctl_read_proc(char *page, char **start, off_t off, ...@@ -604,7 +604,7 @@ int b1ctl_read_proc(char *page, char **start, off_t off,
len += sprintf(page+len, "%-16s %s\n", "ver_serial", s); len += sprintf(page+len, "%-16s %s\n", "ver_serial", s);
if (card->cardtype != avm_m1) { if (card->cardtype != avm_m1) {
flag = ((__u8 *)(ctrl->profile.manu))[3]; flag = ((u8 *)(ctrl->profile.manu))[3];
if (flag) if (flag)
len += sprintf(page+len, "%-16s%s%s%s%s%s%s%s\n", len += sprintf(page+len, "%-16s%s%s%s%s%s%s%s\n",
"protocol", "protocol",
...@@ -618,7 +618,7 @@ int b1ctl_read_proc(char *page, char **start, off_t off, ...@@ -618,7 +618,7 @@ int b1ctl_read_proc(char *page, char **start, off_t off,
); );
} }
if (card->cardtype != avm_m1) { if (card->cardtype != avm_m1) {
flag = ((__u8 *)(ctrl->profile.manu))[5]; flag = ((u8 *)(ctrl->profile.manu))[5];
if (flag) if (flag)
len += sprintf(page+len, "%-16s%s%s%s%s\n", len += sprintf(page+len, "%-16s%s%s%s%s\n",
"linetype", "linetype",
......
...@@ -130,41 +130,41 @@ static int b1dma_fromlink(avmcard *card, void *buf, unsigned int len) ...@@ -130,41 +130,41 @@ static int b1dma_fromlink(avmcard *card, void *buf, unsigned int len)
return 0; return 0;
} }
static int WriteReg(avmcard *card, __u32 reg, __u8 val) static int WriteReg(avmcard *card, u32 reg, u8 val)
{ {
__u8 cmd = 0x00; u8 cmd = 0x00;
if ( b1dma_tolink(card, &cmd, 1) == 0 if ( b1dma_tolink(card, &cmd, 1) == 0
&& b1dma_tolink(card, &reg, 4) == 0) { && b1dma_tolink(card, &reg, 4) == 0) {
__u32 tmp = val; u32 tmp = val;
return b1dma_tolink(card, &tmp, 4); return b1dma_tolink(card, &tmp, 4);
} }
return -1; return -1;
} }
static __u8 ReadReg(avmcard *card, __u32 reg) static u8 ReadReg(avmcard *card, u32 reg)
{ {
__u8 cmd = 0x01; u8 cmd = 0x01;
if ( b1dma_tolink(card, &cmd, 1) == 0 if ( b1dma_tolink(card, &cmd, 1) == 0
&& b1dma_tolink(card, &reg, 4) == 0) { && b1dma_tolink(card, &reg, 4) == 0) {
__u32 tmp; u32 tmp;
if (b1dma_fromlink(card, &tmp, 4) == 0) if (b1dma_fromlink(card, &tmp, 4) == 0)
return (__u8)tmp; return (u8)tmp;
} }
return 0xff; return 0xff;
} }
/* ------------------------------------------------------------- */ /* ------------------------------------------------------------- */
static inline void _put_byte(void **pp, __u8 val) static inline void _put_byte(void **pp, u8 val)
{ {
__u8 *s = *pp; u8 *s = *pp;
*s++ = val; *s++ = val;
*pp = s; *pp = s;
} }
static inline void _put_word(void **pp, __u32 val) static inline void _put_word(void **pp, u32 val)
{ {
__u8 *s = *pp; u8 *s = *pp;
*s++ = val & 0xff; *s++ = val & 0xff;
*s++ = (val >> 8) & 0xff; *s++ = (val >> 8) & 0xff;
*s++ = (val >> 16) & 0xff; *s++ = (val >> 16) & 0xff;
...@@ -180,19 +180,19 @@ static inline void _put_slice(void **pp, unsigned char *dp, unsigned int len) ...@@ -180,19 +180,19 @@ static inline void _put_slice(void **pp, unsigned char *dp, unsigned int len)
_put_byte(pp, *dp++); _put_byte(pp, *dp++);
} }
static inline __u8 _get_byte(void **pp) static inline u8 _get_byte(void **pp)
{ {
__u8 *s = *pp; u8 *s = *pp;
__u8 val; u8 val;
val = *s++; val = *s++;
*pp = s; *pp = s;
return val; return val;
} }
static inline __u32 _get_word(void **pp) static inline u32 _get_word(void **pp)
{ {
__u8 *s = *pp; u8 *s = *pp;
__u32 val; u32 val;
val = *s++; val = *s++;
val |= (*s++ << 8); val |= (*s++ << 8);
val |= (*s++ << 16); val |= (*s++ << 16);
...@@ -201,7 +201,7 @@ static inline __u32 _get_word(void **pp) ...@@ -201,7 +201,7 @@ static inline __u32 _get_word(void **pp)
return val; return val;
} }
static inline __u32 _get_slice(void **pp, unsigned char *dp) static inline u32 _get_slice(void **pp, unsigned char *dp)
{ {
unsigned int len, i; unsigned int len, i;
...@@ -357,9 +357,9 @@ static void b1dma_dispatch_tx(avmcard *card) ...@@ -357,9 +357,9 @@ static void b1dma_dispatch_tx(avmcard *card)
avmcard_dmainfo *dma = card->dma; avmcard_dmainfo *dma = card->dma;
unsigned long flags; unsigned long flags;
struct sk_buff *skb; struct sk_buff *skb;
__u8 cmd, subcmd; u8 cmd, subcmd;
__u16 len; u16 len;
__u32 txlen; u32 txlen;
int inint; int inint;
void *p; void *p;
...@@ -391,7 +391,7 @@ static void b1dma_dispatch_tx(avmcard *card) ...@@ -391,7 +391,7 @@ static void b1dma_dispatch_tx(avmcard *card)
p = dma->sendbuf.dmabuf; p = dma->sendbuf.dmabuf;
if (CAPICMD(cmd, subcmd) == CAPI_DATA_B3_REQ) { if (CAPICMD(cmd, subcmd) == CAPI_DATA_B3_REQ) {
__u16 dlen = CAPIMSG_DATALEN(skb->data); u16 dlen = CAPIMSG_DATALEN(skb->data);
_put_byte(&p, SEND_DATA_B3_REQ); _put_byte(&p, SEND_DATA_B3_REQ);
_put_slice(&p, skb->data, len); _put_slice(&p, skb->data, len);
_put_slice(&p, skb->data + len, dlen); _put_slice(&p, skb->data + len, dlen);
...@@ -399,7 +399,7 @@ static void b1dma_dispatch_tx(avmcard *card) ...@@ -399,7 +399,7 @@ static void b1dma_dispatch_tx(avmcard *card)
_put_byte(&p, SEND_MESSAGE); _put_byte(&p, SEND_MESSAGE);
_put_slice(&p, skb->data, len); _put_slice(&p, skb->data, len);
} }
txlen = (__u8 *)p - (__u8 *)dma->sendbuf.dmabuf; txlen = (u8 *)p - (u8 *)dma->sendbuf.dmabuf;
#ifdef CONFIG_B1DMA_DEBUG #ifdef CONFIG_B1DMA_DEBUG
printk(KERN_DEBUG "tx(%d): put msg len=%d\n", printk(KERN_DEBUG "tx(%d): put msg len=%d\n",
inint, txlen); inint, txlen);
...@@ -447,7 +447,7 @@ static void queue_pollack(avmcard *card) ...@@ -447,7 +447,7 @@ static void queue_pollack(avmcard *card)
_put_byte(&p, 0); _put_byte(&p, 0);
_put_byte(&p, 0); _put_byte(&p, 0);
_put_byte(&p, SEND_POLLACK); _put_byte(&p, SEND_POLLACK);
skb_put(skb, (__u8 *)p - (__u8 *)skb->data); skb_put(skb, (u8 *)p - (u8 *)skb->data);
skb_queue_tail(&card->dma->send_queue, skb); skb_queue_tail(&card->dma->send_queue, skb);
b1dma_dispatch_tx(card); b1dma_dispatch_tx(card);
...@@ -462,8 +462,8 @@ static void b1dma_handle_rx(avmcard *card) ...@@ -462,8 +462,8 @@ static void b1dma_handle_rx(avmcard *card)
struct capi_ctr *ctrl = cinfo->capi_ctrl; struct capi_ctr *ctrl = cinfo->capi_ctrl;
struct sk_buff *skb; struct sk_buff *skb;
void *p = dma->recvbuf.dmabuf+4; void *p = dma->recvbuf.dmabuf+4;
__u32 ApplId, MsgLen, DataB3Len, NCCI, WindowSize; u32 ApplId, MsgLen, DataB3Len, NCCI, WindowSize;
__u8 b1cmd = _get_byte(&p); u8 b1cmd = _get_byte(&p);
#ifdef CONFIG_B1DMA_DEBUG #ifdef CONFIG_B1DMA_DEBUG
printk(KERN_DEBUG "rx: 0x%x %lu\n", b1cmd, (unsigned long)dma->recvlen); printk(KERN_DEBUG "rx: 0x%x %lu\n", b1cmd, (unsigned long)dma->recvlen);
...@@ -585,8 +585,8 @@ static void b1dma_handle_rx(avmcard *card) ...@@ -585,8 +585,8 @@ static void b1dma_handle_rx(avmcard *card)
static void b1dma_handle_interrupt(avmcard *card) static void b1dma_handle_interrupt(avmcard *card)
{ {
__u32 status = b1dmainmeml(card->mbase+AMCC_INTCSR); u32 status = b1dmainmeml(card->mbase+AMCC_INTCSR);
__u32 newcsr; u32 newcsr;
if ((status & ANY_S5933_INT) == 0) if ((status & ANY_S5933_INT) == 0)
return; return;
...@@ -598,9 +598,9 @@ static void b1dma_handle_interrupt(avmcard *card) ...@@ -598,9 +598,9 @@ static void b1dma_handle_interrupt(avmcard *card)
if ((status & RX_TC_INT) != 0) { if ((status & RX_TC_INT) != 0) {
struct avmcard_dmainfo *dma = card->dma; struct avmcard_dmainfo *dma = card->dma;
__u32 rxlen; u32 rxlen;
if (card->dma->recvlen == 0) { if (card->dma->recvlen == 0) {
dma->recvlen = *((__u32 *)dma->recvbuf.dmabuf); dma->recvlen = *((u32 *)dma->recvbuf.dmabuf);
rxlen = (dma->recvlen + 3) & ~3; rxlen = (dma->recvlen + 3) & ~3;
b1dmaoutmeml(card->mbase+AMCC_RXPTR, b1dmaoutmeml(card->mbase+AMCC_RXPTR,
dma->recvbuf.dmaaddr+4); dma->recvbuf.dmaaddr+4);
...@@ -695,7 +695,7 @@ static void b1dma_send_init(avmcard *card) ...@@ -695,7 +695,7 @@ static void b1dma_send_init(avmcard *card)
_put_word(&p, CAPI_MAXAPPL); _put_word(&p, CAPI_MAXAPPL);
_put_word(&p, AVM_NCCI_PER_CHANNEL*30); _put_word(&p, AVM_NCCI_PER_CHANNEL*30);
_put_word(&p, card->cardnr - 1); _put_word(&p, card->cardnr - 1);
skb_put(skb, (__u8 *)p - (__u8 *)skb->data); skb_put(skb, (u8 *)p - (u8 *)skb->data);
skb_queue_tail(&card->dma->send_queue, skb); skb_queue_tail(&card->dma->send_queue, skb);
b1dma_dispatch_tx(card); b1dma_dispatch_tx(card);
...@@ -772,7 +772,7 @@ void b1dma_reset_ctr(struct capi_ctr *ctrl) ...@@ -772,7 +772,7 @@ void b1dma_reset_ctr(struct capi_ctr *ctrl)
void b1dma_register_appl(struct capi_ctr *ctrl, void b1dma_register_appl(struct capi_ctr *ctrl,
__u16 appl, u16 appl,
capi_register_params *rp) capi_register_params *rp)
{ {
avmctrl_info *cinfo = (avmctrl_info *)(ctrl->driverdata); avmctrl_info *cinfo = (avmctrl_info *)(ctrl->driverdata);
...@@ -801,7 +801,7 @@ void b1dma_register_appl(struct capi_ctr *ctrl, ...@@ -801,7 +801,7 @@ void b1dma_register_appl(struct capi_ctr *ctrl,
_put_word(&p, nconn); _put_word(&p, nconn);
_put_word(&p, rp->datablkcnt); _put_word(&p, rp->datablkcnt);
_put_word(&p, rp->datablklen); _put_word(&p, rp->datablklen);
skb_put(skb, (__u8 *)p - (__u8 *)skb->data); skb_put(skb, (u8 *)p - (u8 *)skb->data);
skb_queue_tail(&card->dma->send_queue, skb); skb_queue_tail(&card->dma->send_queue, skb);
b1dma_dispatch_tx(card); b1dma_dispatch_tx(card);
...@@ -811,7 +811,7 @@ void b1dma_register_appl(struct capi_ctr *ctrl, ...@@ -811,7 +811,7 @@ void b1dma_register_appl(struct capi_ctr *ctrl,
/* ------------------------------------------------------------- */ /* ------------------------------------------------------------- */
void b1dma_release_appl(struct capi_ctr *ctrl, __u16 appl) void b1dma_release_appl(struct capi_ctr *ctrl, u16 appl)
{ {
avmctrl_info *cinfo = (avmctrl_info *)(ctrl->driverdata); avmctrl_info *cinfo = (avmctrl_info *)(ctrl->driverdata);
avmcard *card = cinfo->card; avmcard *card = cinfo->card;
...@@ -830,7 +830,7 @@ void b1dma_release_appl(struct capi_ctr *ctrl, __u16 appl) ...@@ -830,7 +830,7 @@ void b1dma_release_appl(struct capi_ctr *ctrl, __u16 appl)
_put_byte(&p, SEND_RELEASE); _put_byte(&p, SEND_RELEASE);
_put_word(&p, appl); _put_word(&p, appl);
skb_put(skb, (__u8 *)p - (__u8 *)skb->data); skb_put(skb, (u8 *)p - (u8 *)skb->data);
skb_queue_tail(&card->dma->send_queue, skb); skb_queue_tail(&card->dma->send_queue, skb);
b1dma_dispatch_tx(card); b1dma_dispatch_tx(card);
} }
...@@ -853,10 +853,10 @@ int b1dmactl_read_proc(char *page, char **start, off_t off, ...@@ -853,10 +853,10 @@ int b1dmactl_read_proc(char *page, char **start, off_t off,
avmctrl_info *cinfo = (avmctrl_info *)(ctrl->driverdata); avmctrl_info *cinfo = (avmctrl_info *)(ctrl->driverdata);
avmcard *card = cinfo->card; avmcard *card = cinfo->card;
unsigned long flags; unsigned long flags;
__u8 flag; u8 flag;
int len = 0; int len = 0;
char *s; char *s;
__u32 txoff, txlen, rxoff, rxlen, csr; u32 txoff, txlen, rxoff, rxlen, csr;
len += sprintf(page+len, "%-16s %s\n", "name", card->name); len += sprintf(page+len, "%-16s %s\n", "name", card->name);
len += sprintf(page+len, "%-16s 0x%x\n", "io", card->port); len += sprintf(page+len, "%-16s 0x%x\n", "io", card->port);
...@@ -883,7 +883,7 @@ int b1dmactl_read_proc(char *page, char **start, off_t off, ...@@ -883,7 +883,7 @@ int b1dmactl_read_proc(char *page, char **start, off_t off,
len += sprintf(page+len, "%-16s %s\n", "ver_serial", s); len += sprintf(page+len, "%-16s %s\n", "ver_serial", s);
if (card->cardtype != avm_m1) { if (card->cardtype != avm_m1) {
flag = ((__u8 *)(ctrl->profile.manu))[3]; flag = ((u8 *)(ctrl->profile.manu))[3];
if (flag) if (flag)
len += sprintf(page+len, "%-16s%s%s%s%s%s%s%s\n", len += sprintf(page+len, "%-16s%s%s%s%s%s%s%s\n",
"protocol", "protocol",
...@@ -897,7 +897,7 @@ int b1dmactl_read_proc(char *page, char **start, off_t off, ...@@ -897,7 +897,7 @@ int b1dmactl_read_proc(char *page, char **start, off_t off,
); );
} }
if (card->cardtype != avm_m1) { if (card->cardtype != avm_m1) {
flag = ((__u8 *)(ctrl->profile.manu))[5]; flag = ((u8 *)(ctrl->profile.manu))[5];
if (flag) if (flag)
len += sprintf(page+len, "%-16s%s%s%s%s\n", len += sprintf(page+len, "%-16s%s%s%s%s\n",
"linetype", "linetype",
......
...@@ -193,14 +193,14 @@ static int c4_peek(avmcard *card, unsigned long off, unsigned long *valuep) ...@@ -193,14 +193,14 @@ static int c4_peek(avmcard *card, unsigned long off, unsigned long *valuep)
static int c4_load_t4file(avmcard *card, capiloaddatapart * t4file) static int c4_load_t4file(avmcard *card, capiloaddatapart * t4file)
{ {
__u32 val; u32 val;
unsigned char *dp; unsigned char *dp;
int left, retval; int left, retval;
__u32 loadoff = 0; u32 loadoff = 0;
dp = t4file->data; dp = t4file->data;
left = t4file->len; left = t4file->len;
while (left >= sizeof(__u32)) { while (left >= sizeof(u32)) {
if (t4file->user) { if (t4file->user) {
retval = copy_from_user(&val, dp, sizeof(val)); retval = copy_from_user(&val, dp, sizeof(val));
if (retval) if (retval)
...@@ -213,9 +213,9 @@ static int c4_load_t4file(avmcard *card, capiloaddatapart * t4file) ...@@ -213,9 +213,9 @@ static int c4_load_t4file(avmcard *card, capiloaddatapart * t4file)
card->name); card->name);
return -EIO; return -EIO;
} }
left -= sizeof(__u32); left -= sizeof(u32);
dp += sizeof(__u32); dp += sizeof(u32);
loadoff += sizeof(__u32); loadoff += sizeof(u32);
} }
if (left) { if (left) {
val = 0; val = 0;
...@@ -237,16 +237,16 @@ static int c4_load_t4file(avmcard *card, capiloaddatapart * t4file) ...@@ -237,16 +237,16 @@ static int c4_load_t4file(avmcard *card, capiloaddatapart * t4file)
/* ------------------------------------------------------------- */ /* ------------------------------------------------------------- */
static inline void _put_byte(void **pp, __u8 val) static inline void _put_byte(void **pp, u8 val)
{ {
__u8 *s = *pp; u8 *s = *pp;
*s++ = val; *s++ = val;
*pp = s; *pp = s;
} }
static inline void _put_word(void **pp, __u32 val) static inline void _put_word(void **pp, u32 val)
{ {
__u8 *s = *pp; u8 *s = *pp;
*s++ = val & 0xff; *s++ = val & 0xff;
*s++ = (val >> 8) & 0xff; *s++ = (val >> 8) & 0xff;
*s++ = (val >> 16) & 0xff; *s++ = (val >> 16) & 0xff;
...@@ -262,19 +262,19 @@ static inline void _put_slice(void **pp, unsigned char *dp, unsigned int len) ...@@ -262,19 +262,19 @@ static inline void _put_slice(void **pp, unsigned char *dp, unsigned int len)
_put_byte(pp, *dp++); _put_byte(pp, *dp++);
} }
static inline __u8 _get_byte(void **pp) static inline u8 _get_byte(void **pp)
{ {
__u8 *s = *pp; u8 *s = *pp;
__u8 val; u8 val;
val = *s++; val = *s++;
*pp = s; *pp = s;
return val; return val;
} }
static inline __u32 _get_word(void **pp) static inline u32 _get_word(void **pp)
{ {
__u8 *s = *pp; u8 *s = *pp;
__u32 val; u32 val;
val = *s++; val = *s++;
val |= (*s++ << 8); val |= (*s++ << 8);
val |= (*s++ << 16); val |= (*s++ << 16);
...@@ -283,7 +283,7 @@ static inline __u32 _get_word(void **pp) ...@@ -283,7 +283,7 @@ static inline __u32 _get_word(void **pp)
return val; return val;
} }
static inline __u32 _get_slice(void **pp, unsigned char *dp) static inline u32 _get_slice(void **pp, unsigned char *dp)
{ {
unsigned int len, i; unsigned int len, i;
...@@ -411,9 +411,9 @@ static void c4_dispatch_tx(avmcard *card) ...@@ -411,9 +411,9 @@ static void c4_dispatch_tx(avmcard *card)
avmcard_dmainfo *dma = card->dma; avmcard_dmainfo *dma = card->dma;
unsigned long flags; unsigned long flags;
struct sk_buff *skb; struct sk_buff *skb;
__u8 cmd, subcmd; u8 cmd, subcmd;
__u16 len; u16 len;
__u32 txlen; u32 txlen;
void *p; void *p;
save_flags(flags); save_flags(flags);
...@@ -442,7 +442,7 @@ static void c4_dispatch_tx(avmcard *card) ...@@ -442,7 +442,7 @@ static void c4_dispatch_tx(avmcard *card)
p = dma->sendbuf.dmabuf; p = dma->sendbuf.dmabuf;
if (CAPICMD(cmd, subcmd) == CAPI_DATA_B3_REQ) { if (CAPICMD(cmd, subcmd) == CAPI_DATA_B3_REQ) {
__u16 dlen = CAPIMSG_DATALEN(skb->data); u16 dlen = CAPIMSG_DATALEN(skb->data);
_put_byte(&p, SEND_DATA_B3_REQ); _put_byte(&p, SEND_DATA_B3_REQ);
_put_slice(&p, skb->data, len); _put_slice(&p, skb->data, len);
_put_slice(&p, skb->data + len, dlen); _put_slice(&p, skb->data + len, dlen);
...@@ -450,7 +450,7 @@ static void c4_dispatch_tx(avmcard *card) ...@@ -450,7 +450,7 @@ static void c4_dispatch_tx(avmcard *card)
_put_byte(&p, SEND_MESSAGE); _put_byte(&p, SEND_MESSAGE);
_put_slice(&p, skb->data, len); _put_slice(&p, skb->data, len);
} }
txlen = (__u8 *)p - (__u8 *)dma->sendbuf.dmabuf; txlen = (u8 *)p - (u8 *)dma->sendbuf.dmabuf;
#ifdef CONFIG_C4_DEBUG #ifdef CONFIG_C4_DEBUG
printk(KERN_DEBUG "%s: tx put msg len=%d\n", card->name, txlen); printk(KERN_DEBUG "%s: tx put msg len=%d\n", card->name, txlen);
#endif #endif
...@@ -496,7 +496,7 @@ static void queue_pollack(avmcard *card) ...@@ -496,7 +496,7 @@ static void queue_pollack(avmcard *card)
_put_byte(&p, 0); _put_byte(&p, 0);
_put_byte(&p, 0); _put_byte(&p, 0);
_put_byte(&p, SEND_POLLACK); _put_byte(&p, SEND_POLLACK);
skb_put(skb, (__u8 *)p - (__u8 *)skb->data); skb_put(skb, (u8 *)p - (u8 *)skb->data);
skb_queue_tail(&card->dma->send_queue, skb); skb_queue_tail(&card->dma->send_queue, skb);
c4_dispatch_tx(card); c4_dispatch_tx(card);
...@@ -511,9 +511,9 @@ static void c4_handle_rx(avmcard *card) ...@@ -511,9 +511,9 @@ static void c4_handle_rx(avmcard *card)
avmctrl_info *cinfo; avmctrl_info *cinfo;
struct sk_buff *skb; struct sk_buff *skb;
void *p = dma->recvbuf.dmabuf; void *p = dma->recvbuf.dmabuf;
__u32 ApplId, MsgLen, DataB3Len, NCCI, WindowSize; u32 ApplId, MsgLen, DataB3Len, NCCI, WindowSize;
__u8 b1cmd = _get_byte(&p); u8 b1cmd = _get_byte(&p);
__u32 cidx; u32 cidx;
#ifdef CONFIG_C4_DEBUG #ifdef CONFIG_C4_DEBUG
...@@ -674,7 +674,7 @@ static void c4_handle_rx(avmcard *card) ...@@ -674,7 +674,7 @@ static void c4_handle_rx(avmcard *card)
static void c4_handle_interrupt(avmcard *card) static void c4_handle_interrupt(avmcard *card)
{ {
__u32 status = c4inmeml(card->mbase+DOORBELL); u32 status = c4inmeml(card->mbase+DOORBELL);
if (status & DBELL_RESET_HOST) { if (status & DBELL_RESET_HOST) {
int i; int i;
...@@ -760,13 +760,13 @@ static void c4_send_init(avmcard *card) ...@@ -760,13 +760,13 @@ static void c4_send_init(avmcard *card)
_put_word(&p, CAPI_MAXAPPL); _put_word(&p, CAPI_MAXAPPL);
_put_word(&p, AVM_NCCI_PER_CHANNEL*30); _put_word(&p, AVM_NCCI_PER_CHANNEL*30);
_put_word(&p, card->cardnr - 1); _put_word(&p, card->cardnr - 1);
skb_put(skb, (__u8 *)p - (__u8 *)skb->data); skb_put(skb, (u8 *)p - (u8 *)skb->data);
skb_queue_tail(&card->dma->send_queue, skb); skb_queue_tail(&card->dma->send_queue, skb);
c4_dispatch_tx(card); c4_dispatch_tx(card);
} }
static int queue_sendconfigword(avmcard *card, __u32 val) static int queue_sendconfigword(avmcard *card, u32 val)
{ {
struct sk_buff *skb; struct sk_buff *skb;
void *p; void *p;
...@@ -782,7 +782,7 @@ static int queue_sendconfigword(avmcard *card, __u32 val) ...@@ -782,7 +782,7 @@ static int queue_sendconfigword(avmcard *card, __u32 val)
_put_byte(&p, 0); _put_byte(&p, 0);
_put_byte(&p, SEND_CONFIG); _put_byte(&p, SEND_CONFIG);
_put_word(&p, val); _put_word(&p, val);
skb_put(skb, (__u8 *)p - (__u8 *)skb->data); skb_put(skb, (u8 *)p - (u8 *)skb->data);
skb_queue_tail(&card->dma->send_queue, skb); skb_queue_tail(&card->dma->send_queue, skb);
c4_dispatch_tx(card); c4_dispatch_tx(card);
...@@ -808,7 +808,7 @@ static int queue_sendconfig(avmcard *card, char cval[4]) ...@@ -808,7 +808,7 @@ static int queue_sendconfig(avmcard *card, char cval[4])
_put_byte(&p, cval[1]); _put_byte(&p, cval[1]);
_put_byte(&p, cval[2]); _put_byte(&p, cval[2]);
_put_byte(&p, cval[3]); _put_byte(&p, cval[3]);
skb_put(skb, (__u8 *)p - (__u8 *)skb->data); skb_put(skb, (u8 *)p - (u8 *)skb->data);
skb_queue_tail(&card->dma->send_queue, skb); skb_queue_tail(&card->dma->send_queue, skb);
c4_dispatch_tx(card); c4_dispatch_tx(card);
...@@ -817,7 +817,7 @@ static int queue_sendconfig(avmcard *card, char cval[4]) ...@@ -817,7 +817,7 @@ static int queue_sendconfig(avmcard *card, char cval[4])
static int c4_send_config(avmcard *card, capiloaddatapart * config) static int c4_send_config(avmcard *card, capiloaddatapart * config)
{ {
__u8 val[4]; u8 val[4];
unsigned char *dp; unsigned char *dp;
int left, retval; int left, retval;
...@@ -828,7 +828,7 @@ static int c4_send_config(avmcard *card, capiloaddatapart * config) ...@@ -828,7 +828,7 @@ static int c4_send_config(avmcard *card, capiloaddatapart * config)
dp = config->data; dp = config->data;
left = config->len; left = config->len;
while (left >= sizeof(__u32)) { while (left >= sizeof(u32)) {
if (config->user) { if (config->user) {
retval = copy_from_user(val, dp, sizeof(val)); retval = copy_from_user(val, dp, sizeof(val));
if (retval) if (retval)
...@@ -954,7 +954,7 @@ static void c4_remove_ctr(struct capi_ctr *ctrl) ...@@ -954,7 +954,7 @@ static void c4_remove_ctr(struct capi_ctr *ctrl)
void c4_register_appl(struct capi_ctr *ctrl, void c4_register_appl(struct capi_ctr *ctrl,
__u16 appl, u16 appl,
capi_register_params *rp) capi_register_params *rp)
{ {
avmctrl_info *cinfo = (avmctrl_info *)(ctrl->driverdata); avmctrl_info *cinfo = (avmctrl_info *)(ctrl->driverdata);
...@@ -985,7 +985,7 @@ void c4_register_appl(struct capi_ctr *ctrl, ...@@ -985,7 +985,7 @@ void c4_register_appl(struct capi_ctr *ctrl,
_put_word(&p, nconn); _put_word(&p, nconn);
_put_word(&p, rp->datablkcnt); _put_word(&p, rp->datablkcnt);
_put_word(&p, rp->datablklen); _put_word(&p, rp->datablklen);
skb_put(skb, (__u8 *)p - (__u8 *)skb->data); skb_put(skb, (u8 *)p - (u8 *)skb->data);
skb_queue_tail(&card->dma->send_queue, skb); skb_queue_tail(&card->dma->send_queue, skb);
c4_dispatch_tx(card); c4_dispatch_tx(card);
...@@ -996,7 +996,7 @@ void c4_register_appl(struct capi_ctr *ctrl, ...@@ -996,7 +996,7 @@ void c4_register_appl(struct capi_ctr *ctrl,
/* ------------------------------------------------------------- */ /* ------------------------------------------------------------- */
void c4_release_appl(struct capi_ctr *ctrl, __u16 appl) void c4_release_appl(struct capi_ctr *ctrl, u16 appl)
{ {
avmctrl_info *cinfo = (avmctrl_info *)(ctrl->driverdata); avmctrl_info *cinfo = (avmctrl_info *)(ctrl->driverdata);
avmcard *card = cinfo->card; avmcard *card = cinfo->card;
...@@ -1016,7 +1016,7 @@ void c4_release_appl(struct capi_ctr *ctrl, __u16 appl) ...@@ -1016,7 +1016,7 @@ void c4_release_appl(struct capi_ctr *ctrl, __u16 appl)
_put_byte(&p, SEND_RELEASE); _put_byte(&p, SEND_RELEASE);
_put_word(&p, appl); _put_word(&p, appl);
skb_put(skb, (__u8 *)p - (__u8 *)skb->data); skb_put(skb, (u8 *)p - (u8 *)skb->data);
skb_queue_tail(&card->dma->send_queue, skb); skb_queue_tail(&card->dma->send_queue, skb);
c4_dispatch_tx(card); c4_dispatch_tx(card);
} }
...@@ -1056,7 +1056,7 @@ static int c4_read_proc(char *page, char **start, off_t off, ...@@ -1056,7 +1056,7 @@ static int c4_read_proc(char *page, char **start, off_t off,
{ {
avmctrl_info *cinfo = (avmctrl_info *)(ctrl->driverdata); avmctrl_info *cinfo = (avmctrl_info *)(ctrl->driverdata);
avmcard *card = cinfo->card; avmcard *card = cinfo->card;
__u8 flag; u8 flag;
int len = 0; int len = 0;
char *s; char *s;
...@@ -1085,7 +1085,7 @@ static int c4_read_proc(char *page, char **start, off_t off, ...@@ -1085,7 +1085,7 @@ static int c4_read_proc(char *page, char **start, off_t off,
len += sprintf(page+len, "%-16s %s\n", "ver_serial", s); len += sprintf(page+len, "%-16s %s\n", "ver_serial", s);
if (card->cardtype != avm_m1) { if (card->cardtype != avm_m1) {
flag = ((__u8 *)(ctrl->profile.manu))[3]; flag = ((u8 *)(ctrl->profile.manu))[3];
if (flag) if (flag)
len += sprintf(page+len, "%-16s%s%s%s%s%s%s%s\n", len += sprintf(page+len, "%-16s%s%s%s%s%s%s%s\n",
"protocol", "protocol",
...@@ -1099,7 +1099,7 @@ static int c4_read_proc(char *page, char **start, off_t off, ...@@ -1099,7 +1099,7 @@ static int c4_read_proc(char *page, char **start, off_t off,
); );
} }
if (card->cardtype != avm_m1) { if (card->cardtype != avm_m1) {
flag = ((__u8 *)(ctrl->profile.manu))[5]; flag = ((u8 *)(ctrl->profile.manu))[5];
if (flag) if (flag)
len += sprintf(page+len, "%-16s%s%s%s%s\n", len += sprintf(page+len, "%-16s%s%s%s%s\n",
"linetype", "linetype",
......
...@@ -484,14 +484,14 @@ static void t1isa_send_message(struct capi_ctr *ctrl, struct sk_buff *skb) ...@@ -484,14 +484,14 @@ static void t1isa_send_message(struct capi_ctr *ctrl, struct sk_buff *skb)
avmcard *card = cinfo->card; avmcard *card = cinfo->card;
unsigned int port = card->port; unsigned int port = card->port;
unsigned long flags; unsigned long flags;
__u16 len = CAPIMSG_LEN(skb->data); u16 len = CAPIMSG_LEN(skb->data);
__u8 cmd = CAPIMSG_COMMAND(skb->data); u8 cmd = CAPIMSG_COMMAND(skb->data);
__u8 subcmd = CAPIMSG_SUBCOMMAND(skb->data); u8 subcmd = CAPIMSG_SUBCOMMAND(skb->data);
save_flags(flags); save_flags(flags);
cli(); cli();
if (CAPICMD(cmd, subcmd) == CAPI_DATA_B3_REQ) { if (CAPICMD(cmd, subcmd) == CAPI_DATA_B3_REQ) {
__u16 dlen = CAPIMSG_DATALEN(skb->data); u16 dlen = CAPIMSG_DATALEN(skb->data);
b1_put_byte(port, SEND_DATA_B3_REQ); b1_put_byte(port, SEND_DATA_B3_REQ);
t1_put_slice(port, skb->data, len); t1_put_slice(port, skb->data, len);
t1_put_slice(port, skb->data + len, dlen); t1_put_slice(port, skb->data + len, dlen);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment