Commit 5cacfc4f authored by Linus Torvalds's avatar Linus Torvalds

Merge http://linux-isdn.bkbits.net/linux-2.5.isdn

into penguin.transmeta.com:/home/penguin/torvalds/repositories/kernel/linux
parents c2050b96 2ec163ce
......@@ -10,13 +10,13 @@ export-objs := kcapi.o capiutil.o capifs.o
# Multipart objects.
kernelcapi-objs := kcapi.o
kernelcapi-objs := kcapi.o capiutil.o
# Ordering constraints: kernelcapi.o first
# Each configuration option enables a list of files.
obj-$(CONFIG_ISDN_CAPI) += kernelcapi.o capiutil.o
obj-$(CONFIG_ISDN_CAPI) += kernelcapi.o
obj-$(CONFIG_ISDN_CAPI_CAPI20) += capi.o
obj-$(CONFIG_ISDN_CAPI_CAPIDRV) += capidrv.o
obj-$(CONFIG_ISDN_CAPI_CAPIFS) += capifs.o
......
This diff is collapsed.
......@@ -20,19 +20,15 @@
#include <linux/config.h>
#include <linux/isdn/capiutil.h>
MODULE_DESCRIPTION("CAPI4Linux: CAPI message conversion support");
MODULE_AUTHOR("Carsten Paeth");
MODULE_LICENSE("GPL");
/* from CAPI2.0 DDK AVM Berlin GmbH */
#ifndef CONFIG_ISDN_DRV_AVMB1_VERBOSE_REASON
char *capi_info2str(__u16 reason)
char *capi_info2str(u16 reason)
{
return "..";
}
#else
char *capi_info2str(__u16 reason)
char *capi_info2str(u16 reason)
{
switch (reason) {
......@@ -422,14 +418,14 @@ static unsigned char *cpars[] =
/*-------------------------------------------------------*/
#define byteTLcpy(x,y) *(__u8 *)(x)=*(__u8 *)(y);
#define wordTLcpy(x,y) *(__u16 *)(x)=*(__u16 *)(y);
#define byteTLcpy(x,y) *(u8 *)(x)=*(u8 *)(y);
#define wordTLcpy(x,y) *(u16 *)(x)=*(u16 *)(y);
#define dwordTLcpy(x,y) memcpy(x,y,4);
#define structTLcpy(x,y,l) memcpy (x,y,l)
#define structTLcpyovl(x,y,l) memmove (x,y,l)
#define byteTRcpy(x,y) *(__u8 *)(y)=*(__u8 *)(x);
#define wordTRcpy(x,y) *(__u16 *)(y)=*(__u16 *)(x);
#define byteTRcpy(x,y) *(u8 *)(y)=*(u8 *)(x);
#define wordTRcpy(x,y) *(u16 *)(y)=*(u16 *)(x);
#define dwordTRcpy(x,y) memcpy(y,x,4);
#define structTRcpy(x,y,l) memcpy (y,x,l)
#define structTRcpyovl(x,y,l) memmove (y,x,l)
......@@ -449,7 +445,7 @@ static unsigned command_2_index(unsigned c, unsigned sc)
/*-------------------------------------------------------*/
#define TYP (cdef[cmsg->par[cmsg->p]].typ)
#define OFF (((__u8 *)cmsg)+cdef[cmsg->par[cmsg->p]].off)
#define OFF (((u8 *)cmsg)+cdef[cmsg->par[cmsg->p]].off)
static void jumpcstruct(_cmsg * cmsg)
{
......@@ -486,7 +482,7 @@ static void pars_2_message(_cmsg * cmsg)
cmsg->l += 4;
break;
case _CSTRUCT:
if (*(__u8 **) OFF == 0) {
if (*(u8 **) OFF == 0) {
*(cmsg->m + cmsg->l) = '\0';
cmsg->l++;
} else if (**(_cstruct *) OFF != 0xff) {
......@@ -494,8 +490,8 @@ static void pars_2_message(_cmsg * cmsg)
cmsg->l += 1 + **(_cstruct *) OFF;
} else {
_cstruct s = *(_cstruct *) OFF;
structTLcpy(cmsg->m + cmsg->l, s, 3 + *(__u16 *) (s + 1));
cmsg->l += 3 + *(__u16 *) (s + 1);
structTLcpy(cmsg->m + cmsg->l, s, 3 + *(u16 *) (s + 1));
cmsg->l += 3 + *(u16 *) (s + 1);
}
break;
case _CMSTRUCT:
......@@ -514,7 +510,7 @@ static void pars_2_message(_cmsg * cmsg)
pars_2_message(cmsg);
_ls = cmsg->l - _l - 1;
if (_ls < 255)
(cmsg->m + _l)[0] = (__u8) _ls;
(cmsg->m + _l)[0] = (u8) _ls;
else {
structTLcpyovl(cmsg->m + _l + 3, cmsg->m + _l + 1, _ls);
(cmsg->m + _l)[0] = 0xff;
......@@ -527,7 +523,7 @@ static void pars_2_message(_cmsg * cmsg)
}
/*-------------------------------------------------------*/
unsigned capi_cmsg2message(_cmsg * cmsg, __u8 * msg)
unsigned capi_cmsg2message(_cmsg * cmsg, u8 * msg)
{
cmsg->m = msg;
cmsg->l = 8;
......@@ -564,12 +560,12 @@ static void message_2_pars(_cmsg * cmsg)
cmsg->l += 4;
break;
case _CSTRUCT:
*(__u8 **) OFF = cmsg->m + cmsg->l;
*(u8 **) OFF = cmsg->m + cmsg->l;
if (cmsg->m[cmsg->l] != 0xff)
cmsg->l += 1 + cmsg->m[cmsg->l];
else
cmsg->l += 3 + *(__u16 *) (cmsg->m + cmsg->l + 1);
cmsg->l += 3 + *(u16 *) (cmsg->m + cmsg->l + 1);
break;
case _CMSTRUCT:
/*----- Metastruktur 0 -----*/
......@@ -590,7 +586,7 @@ static void message_2_pars(_cmsg * cmsg)
}
/*-------------------------------------------------------*/
unsigned capi_message2cmsg(_cmsg * cmsg, __u8 * msg)
unsigned capi_message2cmsg(_cmsg * cmsg, u8 * msg)
{
memset(cmsg, 0, sizeof(_cmsg));
cmsg->m = msg;
......@@ -610,9 +606,9 @@ unsigned capi_message2cmsg(_cmsg * cmsg, __u8 * msg)
}
/*-------------------------------------------------------*/
unsigned capi_cmsg_header(_cmsg * cmsg, __u16 _ApplId,
__u8 _Command, __u8 _Subcommand,
__u16 _Messagenumber, __u32 _Controller)
unsigned capi_cmsg_header(_cmsg * cmsg, u16 _ApplId,
u8 _Command, u8 _Subcommand,
u16 _Messagenumber, u32 _Controller)
{
memset(cmsg, 0, sizeof(_cmsg));
cmsg->ApplId = _ApplId;
......@@ -708,7 +704,7 @@ static char *mnames[] =
"MANUFACTURER_RESP"
};
char *capi_cmd2str(__u8 cmd, __u8 subcmd)
char *capi_cmd2str(u8 cmd, u8 subcmd)
{
return mnames[command_2_index(cmd, subcmd)];
}
......@@ -785,7 +781,7 @@ static void bufprint(char *fmt,...)
p += strlen(p);
}
static void printstructlen(__u8 * m, unsigned len)
static void printstructlen(u8 * m, unsigned len)
{
unsigned hex = 0;
for (; len; len--, m++)
......@@ -805,14 +801,14 @@ static void printstructlen(__u8 * m, unsigned len)
bufprint(">");
}
static void printstruct(__u8 * m)
static void printstruct(u8 * m)
{
unsigned len;
if (m[0] != 0xff) {
len = m[0];
m += 1;
} else {
len = ((__u16 *) (m + 1))[0];
len = ((u16 *) (m + 1))[0];
m += 3;
}
printstructlen(m, len);
......@@ -833,15 +829,15 @@ static void protocol_message_2_pars(_cmsg * cmsg, int level)
switch (TYP) {
case _CBYTE:
bufprint("%-*s = 0x%x\n", slen, NAME, *(__u8 *) (cmsg->m + cmsg->l));
bufprint("%-*s = 0x%x\n", slen, NAME, *(u8 *) (cmsg->m + cmsg->l));
cmsg->l++;
break;
case _CWORD:
bufprint("%-*s = 0x%x\n", slen, NAME, *(__u16 *) (cmsg->m + cmsg->l));
bufprint("%-*s = 0x%x\n", slen, NAME, *(u16 *) (cmsg->m + cmsg->l));
cmsg->l += 2;
break;
case _CDWORD:
bufprint("%-*s = 0x%lx\n", slen, NAME, *(__u32 *) (cmsg->m + cmsg->l));
bufprint("%-*s = 0x%lx\n", slen, NAME, *(u32 *) (cmsg->m + cmsg->l));
cmsg->l += 4;
break;
case _CSTRUCT:
......@@ -854,7 +850,7 @@ static void protocol_message_2_pars(_cmsg * cmsg, int level)
if (cmsg->m[cmsg->l] != 0xff)
cmsg->l += 1 + cmsg->m[cmsg->l];
else
cmsg->l += 3 + *(__u16 *) (cmsg->m + cmsg->l + 1);
cmsg->l += 3 + *(u16 *) (cmsg->m + cmsg->l + 1);
break;
......@@ -877,7 +873,7 @@ static void protocol_message_2_pars(_cmsg * cmsg, int level)
}
}
/*-------------------------------------------------------*/
char *capi_message2str(__u8 * msg)
char *capi_message2str(u8 * msg)
{
_cmsg cmsg;
......@@ -909,9 +905,9 @@ char *capi_cmsg2str(_cmsg * cmsg)
cmsg->p = 0;
bufprint("%s ID=%03d #0x%04x LEN=%04d\n",
mnames[command_2_index(cmsg->Command, cmsg->Subcommand)],
((__u16 *) cmsg->m)[1],
((__u16 *) cmsg->m)[3],
((__u16 *) cmsg->m)[0]);
((u16 *) cmsg->m)[1],
((u16 *) cmsg->m)[3],
((u16 *) cmsg->m)[0]);
protocol_message_2_pars(cmsg, 1);
return buf;
}
......@@ -923,15 +919,3 @@ EXPORT_SYMBOL(capi_cmd2str);
EXPORT_SYMBOL(capi_cmsg2str);
EXPORT_SYMBOL(capi_message2str);
EXPORT_SYMBOL(capi_info2str);
static int __init capiutil_init(void)
{
return 0;
}
static void __exit capiutil_exit(void)
{
}
module_init(capiutil_init);
module_exit(capiutil_exit);
......@@ -54,14 +54,14 @@ MODULE_PARM(showcapimsgs, "i");
struct msgidqueue {
struct msgidqueue *next;
__u16 msgid;
u16 msgid;
};
struct capi_ncci {
struct capi_ncci *next;
__u16 applid;
__u32 ncci;
__u32 winsize;
u16 applid;
u32 ncci;
u32 winsize;
int nmsg;
struct msgidqueue *msgidqueue;
struct msgidqueue *msgidlast;
......@@ -70,11 +70,11 @@ struct capi_ncci {
};
struct capi_appl {
__u16 applid;
u16 applid;
capi_register_params rparam;
int releasing;
void *param;
void (*signal) (__u16 applid, void *param);
void (*signal) (u16 applid, void *param);
struct sk_buff_head recv_queue;
int nncci;
struct capi_ncci *nccilist;
......@@ -88,9 +88,9 @@ struct capi_appl {
struct capi_notifier {
struct capi_notifier *next;
unsigned int cmd;
__u32 controller;
__u16 applid;
__u32 ncci;
u32 controller;
u16 applid;
u32 ncci;
};
/* ------------------------------------------------------------- */
......@@ -136,7 +136,7 @@ static char *cardstate2str(unsigned short cardstate)
}
}
static inline int capi_cmd_valid(__u8 cmd)
static inline int capi_cmd_valid(u8 cmd)
{
switch (cmd) {
case CAPI_ALERT:
......@@ -159,7 +159,7 @@ static inline int capi_cmd_valid(__u8 cmd)
return 0;
}
static inline int capi_subcmd_valid(__u8 subcmd)
static inline int capi_subcmd_valid(u8 subcmd)
{
switch (subcmd) {
case CAPI_REQ:
......@@ -511,8 +511,8 @@ static inline struct capi_notifier *notify_dequeue(void)
return np;
}
static int notify_push(unsigned int cmd, __u32 controller,
__u16 applid, __u32 ncci)
static int notify_push(unsigned int cmd, u32 controller,
u16 applid, u32 ncci)
{
struct capi_notifier *np;
......@@ -541,7 +541,7 @@ static int notify_push(unsigned int cmd, __u32 controller,
/* -------- KCI_CONTRUP --------------------------------------- */
static void notify_up(__u32 contr)
static void notify_up(u32 contr)
{
struct capi_interface_user *p;
......@@ -556,7 +556,7 @@ static void notify_up(__u32 contr)
/* -------- KCI_CONTRDOWN ------------------------------------- */
static void notify_down(__u32 contr)
static void notify_down(u32 contr)
{
struct capi_interface_user *p;
printk(KERN_NOTICE "kcapi: notify down contr %d\n", contr);
......@@ -570,7 +570,7 @@ static void notify_down(__u32 contr)
/* -------- KCI_NCCIUP ---------------------------------------- */
static void notify_ncciup(__u32 contr, __u16 applid, __u32 ncci)
static void notify_ncciup(u32 contr, u16 applid, u32 ncci)
{
struct capi_interface_user *p;
struct capi_ncciinfo n;
......@@ -587,7 +587,7 @@ static void notify_ncciup(__u32 contr, __u16 applid, __u32 ncci)
/* -------- KCI_NCCIDOWN -------------------------------------- */
static void notify_nccidown(__u32 contr, __u16 applid, __u32 ncci)
static void notify_nccidown(u32 contr, u16 applid, u32 ncci)
{
struct capi_interface_user *p;
struct capi_ncciinfo n;
......@@ -650,7 +650,7 @@ static inline void mq_init(struct capi_ncci * np)
}
}
static inline int mq_enqueue(struct capi_ncci * np, __u16 msgid)
static inline int mq_enqueue(struct capi_ncci * np, u16 msgid)
{
struct msgidqueue *mq;
if ((mq = np->msgidfree) == 0)
......@@ -667,7 +667,7 @@ static inline int mq_enqueue(struct capi_ncci * np, __u16 msgid)
return 1;
}
static inline int mq_dequeue(struct capi_ncci * np, __u16 msgid)
static inline int mq_dequeue(struct capi_ncci * np, u16 msgid)
{
struct msgidqueue **pp;
for (pp = &np->msgidqueue; *pp; pp = &(*pp)->next) {
......@@ -685,11 +685,11 @@ static inline int mq_dequeue(struct capi_ncci * np, __u16 msgid)
return 0;
}
static void controllercb_appl_registered(struct capi_ctr * card, __u16 appl)
static void controllercb_appl_registered(struct capi_ctr * card, u16 appl)
{
}
static void controllercb_appl_released(struct capi_ctr * card, __u16 appl)
static void controllercb_appl_released(struct capi_ctr * card, u16 appl)
{
struct capi_ncci **pp, **nextpp;
for (pp = &APPL(appl)->nccilist; *pp; pp = nextpp) {
......@@ -716,7 +716,7 @@ static void controllercb_appl_released(struct capi_ctr * card, __u16 appl)
*/
static void controllercb_new_ncci(struct capi_ctr * card,
__u16 appl, __u32 ncci, __u32 winsize)
u16 appl, u32 ncci, u32 winsize)
{
struct capi_ncci *np;
if (!VALID_APPLID(appl)) {
......@@ -745,7 +745,7 @@ static void controllercb_new_ncci(struct capi_ctr * card,
}
static void controllercb_free_ncci(struct capi_ctr * card,
__u16 appl, __u32 ncci)
u16 appl, u32 ncci)
{
struct capi_ncci **pp;
if (!VALID_APPLID(appl)) {
......@@ -767,7 +767,7 @@ static void controllercb_free_ncci(struct capi_ctr * card,
}
static struct capi_ncci *find_ncci(struct capi_appl * app, __u32 ncci)
static struct capi_ncci *find_ncci(struct capi_appl * app, u32 ncci)
{
struct capi_ncci *np;
for (np = app->nccilist; np; np = np->next) {
......@@ -784,7 +784,7 @@ static void recv_handler(void *dummy)
struct sk_buff *skb;
while ((skb = skb_dequeue(&recv_queue)) != 0) {
__u16 appl = CAPIMSG_APPID(skb->data);
u16 appl = CAPIMSG_APPID(skb->data);
struct capi_ncci *np;
if (!VALID_APPLID(appl)) {
printk(KERN_ERR "kcapi: recv_handler: applid %d ? (%s)\n",
......@@ -817,10 +817,10 @@ static void recv_handler(void *dummy)
}
static void controllercb_handle_capimsg(struct capi_ctr * card,
__u16 appl, struct sk_buff *skb)
u16 appl, struct sk_buff *skb)
{
int showctl = 0;
__u8 cmd, subcmd;
u8 cmd, subcmd;
if (card->cardstate != CARD_RUNNING) {
printk(KERN_INFO "kcapi: controller %d not active, got: %s",
......@@ -862,7 +862,7 @@ static void controllercb_handle_capimsg(struct capi_ctr * card,
static void controllercb_ready(struct capi_ctr * card)
{
__u16 appl;
u16 appl;
card->cardstate = CARD_RUNNING;
......@@ -880,7 +880,7 @@ static void controllercb_ready(struct capi_ctr * card)
static void controllercb_reseted(struct capi_ctr * card)
{
__u16 appl;
u16 appl;
if (card->cardstate == CARD_FREE)
return;
......@@ -1088,7 +1088,7 @@ void detach_capi_driver(struct capi_driver *driver)
/* -------- CAPI2.0 Interface ---------------------------------- */
/* ------------------------------------------------------------- */
static __u16 capi_isinstalled(void)
static u16 capi_isinstalled(void)
{
int i;
for (i = 0; i < CAPI_MAXCONTR; i++) {
......@@ -1098,7 +1098,7 @@ static __u16 capi_isinstalled(void)
return CAPI_REGNOTINSTALLED;
}
static __u16 capi_register(capi_register_params * rparam, __u16 * applidp)
static u16 capi_register(capi_register_params * rparam, u16 * applidp)
{
int appl;
int i;
......@@ -1131,7 +1131,7 @@ static __u16 capi_register(capi_register_params * rparam, __u16 * applidp)
return CAPI_NOERROR;
}
static __u16 capi_release(__u16 applid)
static u16 capi_release(u16 applid)
{
int i;
......@@ -1154,12 +1154,12 @@ static __u16 capi_release(__u16 applid)
return CAPI_NOERROR;
}
static __u16 capi_put_message(__u16 applid, struct sk_buff *skb)
static u16 capi_put_message(u16 applid, struct sk_buff *skb)
{
struct capi_ncci *np;
__u32 contr;
u32 contr;
int showctl = 0;
__u8 cmd, subcmd;
u8 cmd, subcmd;
if (ncards == 0)
return CAPI_REGNOTINSTALLED;
......@@ -1212,7 +1212,7 @@ static __u16 capi_put_message(__u16 applid, struct sk_buff *skb)
return CAPI_NOERROR;
}
static __u16 capi_get_message(__u16 applid, struct sk_buff **msgp)
static u16 capi_get_message(u16 applid, struct sk_buff **msgp)
{
struct sk_buff *skb;
......@@ -1224,8 +1224,8 @@ static __u16 capi_get_message(__u16 applid, struct sk_buff **msgp)
return CAPI_NOERROR;
}
static __u16 capi_set_signal(__u16 applid,
void (*signal) (__u16 applid, void *param),
static u16 capi_set_signal(u16 applid,
void (*signal) (u16 applid, void *param),
void *param)
{
if (!VALID_APPLID(applid))
......@@ -1235,7 +1235,7 @@ static __u16 capi_set_signal(__u16 applid,
return CAPI_NOERROR;
}
static __u16 capi_get_manufacturer(__u32 contr, __u8 buf[CAPI_MANUFACTURER_LEN])
static u16 capi_get_manufacturer(u32 contr, u8 buf[CAPI_MANUFACTURER_LEN])
{
if (contr == 0) {
strncpy(buf, capi_manufakturer, CAPI_MANUFACTURER_LEN);
......@@ -1248,7 +1248,7 @@ static __u16 capi_get_manufacturer(__u32 contr, __u8 buf[CAPI_MANUFACTURER_LEN])
return CAPI_NOERROR;
}
static __u16 capi_get_version(__u32 contr, struct capi_version *verp)
static u16 capi_get_version(u32 contr, struct capi_version *verp)
{
if (contr == 0) {
*verp = driver_version;
......@@ -1261,7 +1261,7 @@ static __u16 capi_get_version(__u32 contr, struct capi_version *verp)
return CAPI_NOERROR;
}
static __u16 capi_get_serial(__u32 contr, __u8 serial[CAPI_SERIAL_LEN])
static u16 capi_get_serial(u32 contr, u8 serial[CAPI_SERIAL_LEN])
{
if (contr == 0) {
strncpy(serial, driver_serial, CAPI_SERIAL_LEN);
......@@ -1274,7 +1274,7 @@ static __u16 capi_get_serial(__u32 contr, __u8 serial[CAPI_SERIAL_LEN])
return CAPI_NOERROR;
}
static __u16 capi_get_profile(__u32 contr, struct capi_profile *profp)
static u16 capi_get_profile(u32 contr, struct capi_profile *profp)
{
if (contr == 0) {
profp->ncontroller = ncards;
......
......@@ -41,12 +41,12 @@ enum avmcardtype {
typedef struct avmcard_dmabuf {
long size;
__u8 *dmabuf;
u8 *dmabuf;
dma_addr_t dmaaddr;
} avmcard_dmabuf;
typedef struct avmcard_dmainfo {
__u32 recvlen;
u32 recvlen;
avmcard_dmabuf recvbuf;
avmcard_dmabuf sendbuf;
......@@ -71,7 +71,7 @@ typedef struct avmcard {
int interrupt;
void *mbase;
volatile __u32 csr;
volatile u32 csr;
avmcard_dmainfo *dma;
struct avmctrl_info {
......@@ -542,9 +542,9 @@ 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,
void b1_register_appl(struct capi_ctr *ctrl, u16 appl,
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_parse_version(avmctrl_info *card);
void b1_handle_interrupt(avmcard * card);
......@@ -567,9 +567,9 @@ 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,
u16 appl,
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);
int b1dmactl_read_proc(char *page, char **start, off_t off,
int count, int *eof, struct capi_ctr *ctrl);
......
......@@ -297,7 +297,7 @@ void b1_reset_ctr(struct capi_ctr *ctrl)
}
void b1_register_appl(struct capi_ctr *ctrl,
__u16 appl,
u16 appl,
capi_register_params *rp)
{
avmctrl_info *cinfo = (avmctrl_info *)(ctrl->driverdata);
......@@ -323,7 +323,7 @@ void b1_register_appl(struct capi_ctr *ctrl,
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);
avmcard *card = cinfo->card;
......@@ -343,14 +343,14 @@ void b1_send_message(struct capi_ctr *ctrl, struct sk_buff *skb)
avmcard *card = cinfo->card;
unsigned int port = card->port;
unsigned long flags;
__u16 len = CAPIMSG_LEN(skb->data);
__u8 cmd = CAPIMSG_COMMAND(skb->data);
__u8 subcmd = CAPIMSG_SUBCOMMAND(skb->data);
u16 len = CAPIMSG_LEN(skb->data);
u8 cmd = CAPIMSG_COMMAND(skb->data);
u8 subcmd = CAPIMSG_SUBCOMMAND(skb->data);
save_flags(flags);
cli();
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_slice(port, skb->data, len);
b1_put_slice(port, skb->data + len, dlen);
......@@ -369,8 +369,8 @@ void b1_parse_version(avmctrl_info *cinfo)
struct capi_ctr *ctrl = cinfo->capi_ctrl;
avmcard *card = cinfo->card;
capi_profile *profp;
__u8 *dversion;
__u8 flag;
u8 *dversion;
u8 flag;
int i, j;
for (j = 0; j < AVM_MAXVERSION; j++)
......@@ -394,7 +394,7 @@ void b1_parse_version(avmctrl_info *cinfo)
profp = &ctrl->profile;
flag = ((__u8 *)(profp->manu))[1];
flag = ((u8 *)(profp->manu))[1];
switch (flag) {
case 0: if (cinfo->version[VER_CARDTYPE])
strcpy(cinfo->cardname, cinfo->version[VER_CARDTYPE]);
......@@ -410,7 +410,7 @@ void b1_parse_version(avmctrl_info *cinfo)
printk(KERN_NOTICE "%s: card %d \"%s\" ready.\n",
card->name, ctrl->cnr, cinfo->cardname);
flag = ((__u8 *)(profp->manu))[3];
flag = ((u8 *)(profp->manu))[3];
if (flag)
printk(KERN_NOTICE "%s: card %d Protocol:%s%s%s%s%s%s%s\n",
card->name,
......@@ -424,7 +424,7 @@ void b1_parse_version(avmctrl_info *cinfo)
(flag & 0x40) ? " 1TR6" : ""
);
flag = ((__u8 *)(profp->manu))[5];
flag = ((u8 *)(profp->manu))[5];
if (flag)
printk(KERN_NOTICE "%s: card %d Linetype:%s%s%s%s\n",
card->name,
......@@ -574,7 +574,7 @@ int b1ctl_read_proc(char *page, char **start, off_t off,
{
avmctrl_info *cinfo = (avmctrl_info *)(ctrl->driverdata);
avmcard *card = cinfo->card;
__u8 flag;
u8 flag;
int len = 0;
char *s;
......@@ -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);
if (card->cardtype != avm_m1) {
flag = ((__u8 *)(ctrl->profile.manu))[3];
flag = ((u8 *)(ctrl->profile.manu))[3];
if (flag)
len += sprintf(page+len, "%-16s%s%s%s%s%s%s%s\n",
"protocol",
......@@ -618,7 +618,7 @@ int b1ctl_read_proc(char *page, char **start, off_t off,
);
}
if (card->cardtype != avm_m1) {
flag = ((__u8 *)(ctrl->profile.manu))[5];
flag = ((u8 *)(ctrl->profile.manu))[5];
if (flag)
len += sprintf(page+len, "%-16s%s%s%s%s\n",
"linetype",
......
......@@ -130,41 +130,41 @@ static int b1dma_fromlink(avmcard *card, void *buf, unsigned int len)
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
&& b1dma_tolink(card, &reg, 4) == 0) {
__u32 tmp = val;
u32 tmp = val;
return b1dma_tolink(card, &tmp, 4);
}
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
&& b1dma_tolink(card, &reg, 4) == 0) {
__u32 tmp;
u32 tmp;
if (b1dma_fromlink(card, &tmp, 4) == 0)
return (__u8)tmp;
return (u8)tmp;
}
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;
*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 >> 8) & 0xff;
*s++ = (val >> 16) & 0xff;
......@@ -180,19 +180,19 @@ static inline void _put_slice(void **pp, unsigned char *dp, unsigned int len)
_put_byte(pp, *dp++);
}
static inline __u8 _get_byte(void **pp)
static inline u8 _get_byte(void **pp)
{
__u8 *s = *pp;
__u8 val;
u8 *s = *pp;
u8 val;
val = *s++;
*pp = s;
return val;
}
static inline __u32 _get_word(void **pp)
static inline u32 _get_word(void **pp)
{
__u8 *s = *pp;
__u32 val;
u8 *s = *pp;
u32 val;
val = *s++;
val |= (*s++ << 8);
val |= (*s++ << 16);
......@@ -201,7 +201,7 @@ static inline __u32 _get_word(void **pp)
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;
......@@ -357,9 +357,9 @@ static void b1dma_dispatch_tx(avmcard *card)
avmcard_dmainfo *dma = card->dma;
unsigned long flags;
struct sk_buff *skb;
__u8 cmd, subcmd;
__u16 len;
__u32 txlen;
u8 cmd, subcmd;
u16 len;
u32 txlen;
int inint;
void *p;
......@@ -391,7 +391,7 @@ static void b1dma_dispatch_tx(avmcard *card)
p = dma->sendbuf.dmabuf;
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_slice(&p, skb->data, len);
_put_slice(&p, skb->data + len, dlen);
......@@ -399,7 +399,7 @@ static void b1dma_dispatch_tx(avmcard *card)
_put_byte(&p, SEND_MESSAGE);
_put_slice(&p, skb->data, len);
}
txlen = (__u8 *)p - (__u8 *)dma->sendbuf.dmabuf;
txlen = (u8 *)p - (u8 *)dma->sendbuf.dmabuf;
#ifdef CONFIG_B1DMA_DEBUG
printk(KERN_DEBUG "tx(%d): put msg len=%d\n",
inint, txlen);
......@@ -447,7 +447,7 @@ static void queue_pollack(avmcard *card)
_put_byte(&p, 0);
_put_byte(&p, 0);
_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);
b1dma_dispatch_tx(card);
......@@ -462,8 +462,8 @@ static void b1dma_handle_rx(avmcard *card)
struct capi_ctr *ctrl = cinfo->capi_ctrl;
struct sk_buff *skb;
void *p = dma->recvbuf.dmabuf+4;
__u32 ApplId, MsgLen, DataB3Len, NCCI, WindowSize;
__u8 b1cmd = _get_byte(&p);
u32 ApplId, MsgLen, DataB3Len, NCCI, WindowSize;
u8 b1cmd = _get_byte(&p);
#ifdef CONFIG_B1DMA_DEBUG
printk(KERN_DEBUG "rx: 0x%x %lu\n", b1cmd, (unsigned long)dma->recvlen);
......@@ -585,8 +585,8 @@ static void b1dma_handle_rx(avmcard *card)
static void b1dma_handle_interrupt(avmcard *card)
{
__u32 status = b1dmainmeml(card->mbase+AMCC_INTCSR);
__u32 newcsr;
u32 status = b1dmainmeml(card->mbase+AMCC_INTCSR);
u32 newcsr;
if ((status & ANY_S5933_INT) == 0)
return;
......@@ -598,9 +598,9 @@ static void b1dma_handle_interrupt(avmcard *card)
if ((status & RX_TC_INT) != 0) {
struct avmcard_dmainfo *dma = card->dma;
__u32 rxlen;
u32 rxlen;
if (card->dma->recvlen == 0) {
dma->recvlen = *((__u32 *)dma->recvbuf.dmabuf);
dma->recvlen = *((u32 *)dma->recvbuf.dmabuf);
rxlen = (dma->recvlen + 3) & ~3;
b1dmaoutmeml(card->mbase+AMCC_RXPTR,
dma->recvbuf.dmaaddr+4);
......@@ -695,7 +695,7 @@ static void b1dma_send_init(avmcard *card)
_put_word(&p, CAPI_MAXAPPL);
_put_word(&p, AVM_NCCI_PER_CHANNEL*30);
_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);
b1dma_dispatch_tx(card);
......@@ -772,7 +772,7 @@ void b1dma_reset_ctr(struct capi_ctr *ctrl)
void b1dma_register_appl(struct capi_ctr *ctrl,
__u16 appl,
u16 appl,
capi_register_params *rp)
{
avmctrl_info *cinfo = (avmctrl_info *)(ctrl->driverdata);
......@@ -801,7 +801,7 @@ void b1dma_register_appl(struct capi_ctr *ctrl,
_put_word(&p, nconn);
_put_word(&p, rp->datablkcnt);
_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);
b1dma_dispatch_tx(card);
......@@ -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);
avmcard *card = cinfo->card;
......@@ -830,7 +830,7 @@ void b1dma_release_appl(struct capi_ctr *ctrl, __u16 appl)
_put_byte(&p, SEND_RELEASE);
_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);
b1dma_dispatch_tx(card);
}
......@@ -853,10 +853,10 @@ int b1dmactl_read_proc(char *page, char **start, off_t off,
avmctrl_info *cinfo = (avmctrl_info *)(ctrl->driverdata);
avmcard *card = cinfo->card;
unsigned long flags;
__u8 flag;
u8 flag;
int len = 0;
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 0x%x\n", "io", card->port);
......@@ -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);
if (card->cardtype != avm_m1) {
flag = ((__u8 *)(ctrl->profile.manu))[3];
flag = ((u8 *)(ctrl->profile.manu))[3];
if (flag)
len += sprintf(page+len, "%-16s%s%s%s%s%s%s%s\n",
"protocol",
......@@ -897,7 +897,7 @@ int b1dmactl_read_proc(char *page, char **start, off_t off,
);
}
if (card->cardtype != avm_m1) {
flag = ((__u8 *)(ctrl->profile.manu))[5];
flag = ((u8 *)(ctrl->profile.manu))[5];
if (flag)
len += sprintf(page+len, "%-16s%s%s%s%s\n",
"linetype",
......
......@@ -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)
{
__u32 val;
u32 val;
unsigned char *dp;
int left, retval;
__u32 loadoff = 0;
u32 loadoff = 0;
dp = t4file->data;
left = t4file->len;
while (left >= sizeof(__u32)) {
while (left >= sizeof(u32)) {
if (t4file->user) {
retval = copy_from_user(&val, dp, sizeof(val));
if (retval)
......@@ -213,9 +213,9 @@ static int c4_load_t4file(avmcard *card, capiloaddatapart * t4file)
card->name);
return -EIO;
}
left -= sizeof(__u32);
dp += sizeof(__u32);
loadoff += sizeof(__u32);
left -= sizeof(u32);
dp += sizeof(u32);
loadoff += sizeof(u32);
}
if (left) {
val = 0;
......@@ -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;
*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 >> 8) & 0xff;
*s++ = (val >> 16) & 0xff;
......@@ -262,19 +262,19 @@ static inline void _put_slice(void **pp, unsigned char *dp, unsigned int len)
_put_byte(pp, *dp++);
}
static inline __u8 _get_byte(void **pp)
static inline u8 _get_byte(void **pp)
{
__u8 *s = *pp;
__u8 val;
u8 *s = *pp;
u8 val;
val = *s++;
*pp = s;
return val;
}
static inline __u32 _get_word(void **pp)
static inline u32 _get_word(void **pp)
{
__u8 *s = *pp;
__u32 val;
u8 *s = *pp;
u32 val;
val = *s++;
val |= (*s++ << 8);
val |= (*s++ << 16);
......@@ -283,7 +283,7 @@ static inline __u32 _get_word(void **pp)
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;
......@@ -411,9 +411,9 @@ static void c4_dispatch_tx(avmcard *card)
avmcard_dmainfo *dma = card->dma;
unsigned long flags;
struct sk_buff *skb;
__u8 cmd, subcmd;
__u16 len;
__u32 txlen;
u8 cmd, subcmd;
u16 len;
u32 txlen;
void *p;
save_flags(flags);
......@@ -442,7 +442,7 @@ static void c4_dispatch_tx(avmcard *card)
p = dma->sendbuf.dmabuf;
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_slice(&p, skb->data, len);
_put_slice(&p, skb->data + len, dlen);
......@@ -450,7 +450,7 @@ static void c4_dispatch_tx(avmcard *card)
_put_byte(&p, SEND_MESSAGE);
_put_slice(&p, skb->data, len);
}
txlen = (__u8 *)p - (__u8 *)dma->sendbuf.dmabuf;
txlen = (u8 *)p - (u8 *)dma->sendbuf.dmabuf;
#ifdef CONFIG_C4_DEBUG
printk(KERN_DEBUG "%s: tx put msg len=%d\n", card->name, txlen);
#endif
......@@ -496,7 +496,7 @@ static void queue_pollack(avmcard *card)
_put_byte(&p, 0);
_put_byte(&p, 0);
_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);
c4_dispatch_tx(card);
......@@ -511,9 +511,9 @@ static void c4_handle_rx(avmcard *card)
avmctrl_info *cinfo;
struct sk_buff *skb;
void *p = dma->recvbuf.dmabuf;
__u32 ApplId, MsgLen, DataB3Len, NCCI, WindowSize;
__u8 b1cmd = _get_byte(&p);
__u32 cidx;
u32 ApplId, MsgLen, DataB3Len, NCCI, WindowSize;
u8 b1cmd = _get_byte(&p);
u32 cidx;
#ifdef CONFIG_C4_DEBUG
......@@ -674,7 +674,7 @@ static void c4_handle_rx(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) {
int i;
......@@ -760,13 +760,13 @@ static void c4_send_init(avmcard *card)
_put_word(&p, CAPI_MAXAPPL);
_put_word(&p, AVM_NCCI_PER_CHANNEL*30);
_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);
c4_dispatch_tx(card);
}
static int queue_sendconfigword(avmcard *card, __u32 val)
static int queue_sendconfigword(avmcard *card, u32 val)
{
struct sk_buff *skb;
void *p;
......@@ -782,7 +782,7 @@ static int queue_sendconfigword(avmcard *card, __u32 val)
_put_byte(&p, 0);
_put_byte(&p, SEND_CONFIG);
_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);
c4_dispatch_tx(card);
......@@ -808,7 +808,7 @@ static int queue_sendconfig(avmcard *card, char cval[4])
_put_byte(&p, cval[1]);
_put_byte(&p, cval[2]);
_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);
c4_dispatch_tx(card);
......@@ -817,7 +817,7 @@ static int queue_sendconfig(avmcard *card, char cval[4])
static int c4_send_config(avmcard *card, capiloaddatapart * config)
{
__u8 val[4];
u8 val[4];
unsigned char *dp;
int left, retval;
......@@ -828,7 +828,7 @@ static int c4_send_config(avmcard *card, capiloaddatapart * config)
dp = config->data;
left = config->len;
while (left >= sizeof(__u32)) {
while (left >= sizeof(u32)) {
if (config->user) {
retval = copy_from_user(val, dp, sizeof(val));
if (retval)
......@@ -954,7 +954,7 @@ static void c4_remove_ctr(struct capi_ctr *ctrl)
void c4_register_appl(struct capi_ctr *ctrl,
__u16 appl,
u16 appl,
capi_register_params *rp)
{
avmctrl_info *cinfo = (avmctrl_info *)(ctrl->driverdata);
......@@ -985,7 +985,7 @@ void c4_register_appl(struct capi_ctr *ctrl,
_put_word(&p, nconn);
_put_word(&p, rp->datablkcnt);
_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);
c4_dispatch_tx(card);
......@@ -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);
avmcard *card = cinfo->card;
......@@ -1016,7 +1016,7 @@ void c4_release_appl(struct capi_ctr *ctrl, __u16 appl)
_put_byte(&p, SEND_RELEASE);
_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);
c4_dispatch_tx(card);
}
......@@ -1056,7 +1056,7 @@ static int c4_read_proc(char *page, char **start, off_t off,
{
avmctrl_info *cinfo = (avmctrl_info *)(ctrl->driverdata);
avmcard *card = cinfo->card;
__u8 flag;
u8 flag;
int len = 0;
char *s;
......@@ -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);
if (card->cardtype != avm_m1) {
flag = ((__u8 *)(ctrl->profile.manu))[3];
flag = ((u8 *)(ctrl->profile.manu))[3];
if (flag)
len += sprintf(page+len, "%-16s%s%s%s%s%s%s%s\n",
"protocol",
......@@ -1099,7 +1099,7 @@ static int c4_read_proc(char *page, char **start, off_t off,
);
}
if (card->cardtype != avm_m1) {
flag = ((__u8 *)(ctrl->profile.manu))[5];
flag = ((u8 *)(ctrl->profile.manu))[5];
if (flag)
len += sprintf(page+len, "%-16s%s%s%s%s\n",
"linetype",
......
......@@ -484,14 +484,14 @@ static void t1isa_send_message(struct capi_ctr *ctrl, struct sk_buff *skb)
avmcard *card = cinfo->card;
unsigned int port = card->port;
unsigned long flags;
__u16 len = CAPIMSG_LEN(skb->data);
__u8 cmd = CAPIMSG_COMMAND(skb->data);
__u8 subcmd = CAPIMSG_SUBCOMMAND(skb->data);
u16 len = CAPIMSG_LEN(skb->data);
u8 cmd = CAPIMSG_COMMAND(skb->data);
u8 subcmd = CAPIMSG_SUBCOMMAND(skb->data);
save_flags(flags);
cli();
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);
t1_put_slice(port, skb->data, len);
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