Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
06082418
Commit
06082418
authored
May 06, 2002
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Plain Diff
Merge
http://linux-isdn.bkbits.net/linux-2.5.isdn
into home.transmeta.com:/home/torvalds/v2.5/linux
parents
56677816
d095870d
Changes
13
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
451 additions
and
533 deletions
+451
-533
drivers/isdn/capi/kcapi.c
drivers/isdn/capi/kcapi.c
+240
-225
drivers/isdn/hardware/avm/b1.c
drivers/isdn/hardware/avm/b1.c
+1
-3
drivers/isdn/hardware/avm/b1dma.c
drivers/isdn/hardware/avm/b1dma.c
+1
-3
drivers/isdn/hardware/avm/b1isa.c
drivers/isdn/hardware/avm/b1isa.c
+19
-29
drivers/isdn/hardware/avm/b1pci.c
drivers/isdn/hardware/avm/b1pci.c
+36
-55
drivers/isdn/hardware/avm/b1pcmcia.c
drivers/isdn/hardware/avm/b1pcmcia.c
+22
-28
drivers/isdn/hardware/avm/c4.c
drivers/isdn/hardware/avm/c4.c
+34
-50
drivers/isdn/hardware/avm/t1isa.c
drivers/isdn/hardware/avm/t1isa.c
+25
-30
drivers/isdn/hardware/avm/t1pci.c
drivers/isdn/hardware/avm/t1pci.c
+18
-27
drivers/isdn/hysdn/hycapi.c
drivers/isdn/hysdn/hycapi.c
+20
-22
include/linux/isdn/capidev.h
include/linux/isdn/capidev.h
+0
-27
include/linux/isdn/capilli.h
include/linux/isdn/capilli.h
+32
-33
include/linux/kernelcapi.h
include/linux/kernelcapi.h
+3
-1
No files found.
drivers/isdn/capi/kcapi.c
View file @
06082418
This diff is collapsed.
Click to expand it.
drivers/isdn/hardware/avm/b1.c
View file @
06082418
...
...
@@ -357,8 +357,6 @@ void b1_register_appl(struct capi_ctr *ctrl,
b1_put_word
(
port
,
rp
->
datablkcnt
);
b1_put_word
(
port
,
rp
->
datablklen
);
restore_flags
(
flags
);
ctrl
->
appl_registered
(
ctrl
,
appl
);
}
void
b1_release_appl
(
struct
capi_ctr
*
ctrl
,
u16
appl
)
...
...
@@ -548,7 +546,7 @@ void b1_interrupt(int interrupt, void *devptr, struct pt_regs *regs)
if
(
NCCI
!=
0xffffffff
)
ctrl
->
free_ncci
(
ctrl
,
ApplId
,
NCCI
);
else
ctrl
->
appl_released
(
ctrl
,
ApplId
);
break
;
case
RECEIVE_START
:
...
...
drivers/isdn/hardware/avm/b1dma.c
View file @
06082418
...
...
@@ -509,7 +509,7 @@ static void b1dma_handle_rx(avmcard *card)
if
(
NCCI
!=
0xffffffff
)
ctrl
->
free_ncci
(
ctrl
,
ApplId
,
NCCI
);
else
ctrl
->
appl_released
(
ctrl
,
ApplId
);
break
;
case
RECEIVE_START
:
...
...
@@ -774,8 +774,6 @@ void b1dma_register_appl(struct capi_ctr *ctrl,
skb_put
(
skb
,
(
u8
*
)
p
-
(
u8
*
)
skb
->
data
);
b1dma_queue_tx
(
card
,
skb
);
ctrl
->
appl_registered
(
ctrl
,
appl
);
}
/* ------------------------------------------------------------- */
...
...
drivers/isdn/hardware/avm/b1isa.c
View file @
06082418
...
...
@@ -34,10 +34,6 @@ MODULE_LICENSE("GPL");
/* ------------------------------------------------------------- */
static
struct
capi_driver_interface
*
di
;
/* ------------------------------------------------------------- */
static
void
b1isa_remove_ctr
(
struct
capi_ctr
*
ctrl
)
{
avmctrl_info
*
cinfo
=
(
avmctrl_info
*
)(
ctrl
->
driverdata
);
...
...
@@ -47,7 +43,7 @@ static void b1isa_remove_ctr(struct capi_ctr *ctrl)
b1_reset
(
port
);
b1_reset
(
port
);
d
i
->
detach
_ctr
(
ctrl
);
d
etach_capi
_ctr
(
ctrl
);
free_irq
(
card
->
irq
,
card
);
release_region
(
card
->
port
,
AVMB1_PORTLEN
);
b1_free_card
(
card
);
...
...
@@ -111,7 +107,7 @@ static int b1isa_add_card(struct capi_driver *driver, struct capicardparams *p)
b1_reset
(
card
->
port
);
b1_getrevision
(
card
);
cinfo
->
capi_ctrl
=
di
->
attach
_ctr
(
driver
,
card
->
name
,
cinfo
);
cinfo
->
capi_ctrl
=
attach_capi
_ctr
(
driver
,
card
->
name
,
cinfo
);
if
(
!
cinfo
->
capi_ctrl
)
{
printk
(
KERN_ERR
"b1isa: attach controller failed.
\n
"
);
retval
=
-
EBUSY
;
...
...
@@ -154,27 +150,27 @@ static char *b1isa_procinfo(struct capi_ctr *ctrl)
/* ------------------------------------------------------------- */
static
struct
capi_driver
b1isa_driver
=
{
name:
"b1isa"
,
revision:
"0.0"
,
load_firmware:
b1_load_firmware
,
reset_ctr:
b1_reset_ctr
,
remove_ctr:
b1isa_remove_ctr
,
register_appl:
b1_register_appl
,
release_appl:
b1_release_appl
,
send_message:
b1_send_message
,
procinfo:
b1isa_procinfo
,
ctr_read_proc:
b1ctl_read_proc
,
driver_read_proc:
0
,
/* use standard driver_read_proc */
add_card:
b1isa_add_card
,
owner:
THIS_MODULE
,
name:
"b1isa"
,
revision:
"0.0"
,
load_firmware:
b1_load_firmware
,
reset_ctr:
b1_reset_ctr
,
remove_ctr:
b1isa_remove_ctr
,
register_appl:
b1_register_appl
,
release_appl:
b1_release_appl
,
send_message:
b1_send_message
,
procinfo:
b1isa_procinfo
,
ctr_read_proc:
b1ctl_read_proc
,
driver_read_proc:
0
,
/* use standard driver_read_proc */
add_card:
b1isa_add_card
,
};
static
int
__init
b1isa_init
(
void
)
{
struct
capi_driver
*
driver
=
&
b1isa_driver
;
char
*
p
;
int
retval
=
0
;
MOD_INC_USE_COUNT
;
...
...
@@ -187,15 +183,9 @@ static int __init b1isa_init(void)
printk
(
KERN_INFO
"%s: revision %s
\n
"
,
driver
->
name
,
driver
->
revision
);
di
=
attach_capi_driver
(
driver
);
if
(
!
di
)
{
printk
(
KERN_ERR
"%s: failed to attach capi_driver
\n
"
,
driver
->
name
);
retval
=
-
EIO
;
}
attach_capi_driver
(
driver
);
MOD_DEC_USE_COUNT
;
return
retval
;
return
0
;
}
static
void
__exit
b1isa_exit
(
void
)
...
...
drivers/isdn/hardware/avm/b1pci.c
View file @
06082418
...
...
@@ -42,10 +42,6 @@ MODULE_LICENSE("GPL");
/* ------------------------------------------------------------- */
static
struct
capi_driver_interface
*
di
;
/* ------------------------------------------------------------- */
static
char
*
b1pci_procinfo
(
struct
capi_ctr
*
ctrl
)
{
avmctrl_info
*
cinfo
=
(
avmctrl_info
*
)(
ctrl
->
driverdata
);
...
...
@@ -113,7 +109,7 @@ static int b1pci_add_card(struct capi_driver *driver,
goto
err_release_region
;
}
cinfo
->
capi_ctrl
=
di
->
attach
_ctr
(
driver
,
card
->
name
,
cinfo
);
cinfo
->
capi_ctrl
=
attach_capi
_ctr
(
driver
,
card
->
name
,
cinfo
);
if
(
!
cinfo
->
capi_ctrl
)
{
printk
(
KERN_ERR
"%s: attach controller failed.
\n
"
,
driver
->
name
);
...
...
@@ -153,7 +149,7 @@ static void b1pci_remove_ctr(struct capi_ctr *ctrl)
b1_reset
(
port
);
b1_reset
(
port
);
d
i
->
detach
_ctr
(
ctrl
);
d
etach_capi
_ctr
(
ctrl
);
free_irq
(
card
->
irq
,
card
);
release_region
(
card
->
port
,
AVMB1_PORTLEN
);
ctrl
->
driverdata
=
0
;
...
...
@@ -165,29 +161,26 @@ static void b1pci_remove_ctr(struct capi_ctr *ctrl)
/* ------------------------------------------------------------- */
static
struct
capi_driver
b1pci_driver
=
{
name:
"b1pci"
,
revision:
"0.0"
,
load_firmware:
b1_load_firmware
,
reset_ctr:
b1_reset_ctr
,
remove_ctr:
b1pci_remove_ctr
,
register_appl:
b1_register_appl
,
release_appl:
b1_release_appl
,
send_message:
b1_send_message
,
procinfo:
b1pci_procinfo
,
ctr_read_proc:
b1ctl_read_proc
,
driver_read_proc:
0
,
/* use standard driver_read_proc */
add_card:
0
,
/* no add_card function */
owner:
THIS_MODULE
,
name:
"b1pci"
,
revision:
"0.0"
,
load_firmware:
b1_load_firmware
,
reset_ctr:
b1_reset_ctr
,
remove_ctr:
b1pci_remove_ctr
,
register_appl:
b1_register_appl
,
release_appl:
b1_release_appl
,
send_message:
b1_send_message
,
procinfo:
b1pci_procinfo
,
ctr_read_proc:
b1ctl_read_proc
,
driver_read_proc:
0
,
/* use standard driver_read_proc */
add_card:
0
,
/* no add_card function */
};
#ifdef CONFIG_ISDN_DRV_AVMB1_B1PCIV4
/* ------------------------------------------------------------- */
static
struct
capi_driver_interface
*
div4
;
/* ------------------------------------------------------------- */
static
char
*
b1pciv4_procinfo
(
struct
capi_ctr
*
ctrl
)
{
avmctrl_info
*
cinfo
=
(
avmctrl_info
*
)(
ctrl
->
driverdata
);
...
...
@@ -274,7 +267,7 @@ static int b1pciv4_add_card(struct capi_driver *driver,
goto
err_unmap
;
}
cinfo
->
capi_ctrl
=
div4
->
attach
_ctr
(
driver
,
card
->
name
,
cinfo
);
cinfo
->
capi_ctrl
=
attach_capi
_ctr
(
driver
,
card
->
name
,
cinfo
);
if
(
!
cinfo
->
capi_ctrl
)
{
printk
(
KERN_ERR
"%s: attach controller failed.
\n
"
,
driver
->
name
);
retval
=
-
EBUSY
;
...
...
@@ -312,7 +305,7 @@ static void b1pciv4_remove_ctr(struct capi_ctr *ctrl)
b1dma_reset
(
card
);
d
iv4
->
detach
_ctr
(
ctrl
);
d
etach_capi
_ctr
(
ctrl
);
free_irq
(
card
->
irq
,
card
);
iounmap
(
card
->
mbase
);
release_region
(
card
->
port
,
AVMB1_PORTLEN
);
...
...
@@ -327,20 +320,21 @@ static void b1pciv4_remove_ctr(struct capi_ctr *ctrl)
static
struct
capi_driver
b1pciv4_driver
=
{
name:
"b1pciv4"
,
revision:
"0.0"
,
load_firmware:
b1dma_load_firmware
,
reset_ctr:
b1dma_reset_ctr
,
remove_ctr:
b1pciv4_remove_ctr
,
register_appl:
b1dma_register_appl
,
release_appl:
b1dma_release_appl
,
send_message:
b1dma_send_message
,
procinfo:
b1pciv4_procinfo
,
ctr_read_proc:
b1dmactl_read_proc
,
driver_read_proc:
0
,
/* use standard driver_read_proc */
add_card:
0
,
/* no add_card function */
owner:
THIS_MODULE
,
name:
"b1pciv4"
,
revision:
"0.0"
,
load_firmware:
b1dma_load_firmware
,
reset_ctr:
b1dma_reset_ctr
,
remove_ctr:
b1pciv4_remove_ctr
,
register_appl:
b1dma_register_appl
,
release_appl:
b1dma_release_appl
,
send_message:
b1dma_send_message
,
procinfo:
b1pciv4_procinfo
,
ctr_read_proc:
b1dmactl_read_proc
,
driver_read_proc:
0
,
/* use standard driver_read_proc */
add_card:
0
,
/* no add_card function */
};
#endif
/* CONFIG_ISDN_DRV_AVMB1_B1PCIV4 */
...
...
@@ -432,25 +426,12 @@ static int __init b1pci_init(void)
printk
(
KERN_INFO
"%s: revision %s
\n
"
,
driver
->
name
,
driver
->
revision
);
di
=
attach_capi_driver
(
driver
);
if
(
!
di
)
{
printk
(
KERN_ERR
"%s: failed to attach capi_driver
\n
"
,
driver
->
name
);
MOD_DEC_USE_COUNT
;
return
-
ENODEV
;
}
attach_capi_driver
(
driver
);
#ifdef CONFIG_ISDN_DRV_AVMB1_B1PCIV4
printk
(
KERN_INFO
"%s: revision %s
\n
"
,
driverv4
->
name
,
driverv4
->
revision
);
div4
=
attach_capi_driver
(
driverv4
);
if
(
!
div4
)
{
detach_capi_driver
(
driver
);
printk
(
KERN_ERR
"%s: failed to attach capi_driver
\n
"
,
driverv4
->
name
);
MOD_DEC_USE_COUNT
;
return
-
ENODEV
;
}
attach_capi_driver
(
driverv4
);
#endif
ncards
=
pci_register_driver
(
&
b1pci_pci_driver
);
...
...
drivers/isdn/hardware/avm/b1pcmcia.c
View file @
06082418
...
...
@@ -35,10 +35,6 @@ MODULE_LICENSE("GPL");
/* ------------------------------------------------------------- */
static
struct
capi_driver_interface
*
di
;
/* ------------------------------------------------------------- */
static
void
b1pcmcia_remove_ctr
(
struct
capi_ctr
*
ctrl
)
{
avmctrl_info
*
cinfo
=
(
avmctrl_info
*
)(
ctrl
->
driverdata
);
...
...
@@ -48,7 +44,7 @@ static void b1pcmcia_remove_ctr(struct capi_ctr *ctrl)
b1_reset
(
port
);
b1_reset
(
port
);
d
i
->
detach
_ctr
(
ctrl
);
d
etach_capi
_ctr
(
ctrl
);
free_irq
(
card
->
irq
,
card
);
b1_free_card
(
card
);
...
...
@@ -103,7 +99,7 @@ static int b1pcmcia_add_card(struct capi_driver *driver,
b1_reset
(
card
->
port
);
b1_getrevision
(
card
);
cinfo
->
capi_ctrl
=
di
->
attach
_ctr
(
driver
,
card
->
name
,
cinfo
);
cinfo
->
capi_ctrl
=
attach_capi
_ctr
(
driver
,
card
->
name
,
cinfo
);
if
(
!
cinfo
->
capi_ctrl
)
{
printk
(
KERN_ERR
"%s: attach controller failed.
\n
"
,
driver
->
name
);
...
...
@@ -152,20 +148,21 @@ static char *b1pcmcia_procinfo(struct capi_ctr *ctrl)
/* ------------------------------------------------------------- */
static
struct
capi_driver
b1pcmcia_driver
=
{
name:
"b1pcmcia"
,
revision:
"0.0"
,
load_firmware:
b1_load_firmware
,
reset_ctr:
b1_reset_ctr
,
remove_ctr:
b1pcmcia_remove_ctr
,
register_appl:
b1_register_appl
,
release_appl:
b1_release_appl
,
send_message:
b1_send_message
,
procinfo:
b1pcmcia_procinfo
,
ctr_read_proc:
b1ctl_read_proc
,
driver_read_proc:
0
,
/* use standard driver_read_proc */
add_card:
0
,
owner:
THIS_MODULE
,
name:
"b1pcmcia"
,
revision:
"0.0"
,
load_firmware:
b1_load_firmware
,
reset_ctr:
b1_reset_ctr
,
remove_ctr:
b1pcmcia_remove_ctr
,
register_appl:
b1_register_appl
,
release_appl:
b1_release_appl
,
send_message:
b1_send_message
,
procinfo:
b1pcmcia_procinfo
,
ctr_read_proc:
b1ctl_read_proc
,
driver_read_proc:
0
,
/* use standard driver_read_proc */
add_card:
0
,
};
/* ------------------------------------------------------------- */
...
...
@@ -187,10 +184,12 @@ int b1pcmcia_addcard_m2(unsigned int port, unsigned irq)
int
b1pcmcia_delcard
(
unsigned
int
port
,
unsigned
irq
)
{
struct
list_head
*
l
;
struct
capi_ctr
*
ctrl
;
avmcard
*
card
;
for
(
ctrl
=
b1pcmcia_driver
.
controller
;
ctrl
;
ctrl
=
ctrl
->
next
)
{
list_for_each
(
l
,
&
b1pcmcia_driver
.
contr_head
)
{
ctrl
=
list_entry
(
l
,
struct
capi_ctr
,
driver_list
);
card
=
((
avmctrl_info
*
)(
ctrl
->
driverdata
))
->
card
;
if
(
card
->
port
==
port
&&
card
->
irq
==
irq
)
{
b1pcmcia_remove_ctr
(
ctrl
);
...
...
@@ -224,13 +223,8 @@ static int __init b1pcmcia_init(void)
printk
(
KERN_INFO
"%s: revision %s
\n
"
,
driver
->
name
,
driver
->
revision
);
di
=
attach_capi_driver
(
driver
);
attach_capi_driver
(
driver
);
if
(
!
di
)
{
printk
(
KERN_ERR
"%s: failed to attach capi_driver
\n
"
,
driver
->
name
);
retval
=
-
EIO
;
}
MOD_DEC_USE_COUNT
;
return
retval
;
}
...
...
drivers/isdn/hardware/avm/c4.c
View file @
06082418
...
...
@@ -52,10 +52,6 @@ MODULE_PARM(suppress_pollack, "0-1i");
/* ------------------------------------------------------------- */
static
struct
capi_driver_interface
*
di
;
/* ------------------------------------------------------------- */
static
void
c4_dispatch_tx
(
avmcard
*
card
);
/* ------------------------------------------------------------- */
...
...
@@ -587,12 +583,6 @@ static void c4_handle_rx(avmcard *card)
ctrl
=
card
->
ctrlinfo
[
cidx
].
capi_ctrl
;
if
(
ctrl
)
ctrl
->
free_ncci
(
ctrl
,
ApplId
,
NCCI
);
}
else
{
for
(
cidx
=
0
;
cidx
<
4
;
cidx
++
)
{
ctrl
=
card
->
ctrlinfo
[
cidx
].
capi_ctrl
;
if
(
ctrl
)
ctrl
->
appl_released
(
ctrl
,
ApplId
);
}
}
break
;
...
...
@@ -918,7 +908,7 @@ static void c4_remove_ctr(struct capi_ctr *ctrl)
for
(
i
=
0
;
i
<
4
;
i
++
)
{
cinfo
=
&
card
->
ctrlinfo
[
i
];
if
(
cinfo
->
capi_ctrl
)
{
d
i
->
detach
_ctr
(
cinfo
->
capi_ctrl
);
d
etach_capi
_ctr
(
cinfo
->
capi_ctrl
);
cinfo
->
capi_ctrl
=
NULL
;
}
}
...
...
@@ -973,8 +963,6 @@ void c4_register_appl(struct capi_ctr *ctrl,
skb_queue_tail
(
&
card
->
dma
->
send_queue
,
skb
);
c4_dispatch_tx
(
card
);
}
ctrl
->
appl_registered
(
ctrl
,
appl
);
}
/* ------------------------------------------------------------- */
...
...
@@ -1170,13 +1158,13 @@ static int c4_add_card(struct capi_driver *driver,
for
(
i
=
0
;
i
<
nr_controllers
;
i
++
)
{
cinfo
=
&
card
->
ctrlinfo
[
i
];
cinfo
->
capi_ctrl
=
di
->
attach
_ctr
(
driver
,
card
->
name
,
cinfo
);
cinfo
->
capi_ctrl
=
attach_capi
_ctr
(
driver
,
card
->
name
,
cinfo
);
if
(
!
cinfo
->
capi_ctrl
)
{
printk
(
KERN_ERR
"%s: attach controller failed (%d).
\n
"
,
driver
->
name
,
i
);
for
(
i
--
;
i
>=
0
;
i
--
)
{
cinfo
=
&
card
->
ctrlinfo
[
i
];
d
i
->
detach
_ctr
(
cinfo
->
capi_ctrl
);
d
etach_capi
_ctr
(
cinfo
->
capi_ctrl
);
}
goto
err_free_irq
;
}
...
...
@@ -1208,37 +1196,39 @@ static int c4_add_card(struct capi_driver *driver,
/* ------------------------------------------------------------- */
static
struct
capi_driver
c2_driver
=
{
name:
"c2"
,
revision:
"0.0"
,
load_firmware:
c4_load_firmware
,
reset_ctr:
c4_reset_ctr
,
remove_ctr:
c4_remove_ctr
,
register_appl:
c4_register_appl
,
release_appl:
c4_release_appl
,
send_message:
c4_send_message
,
procinfo:
c4_procinfo
,
ctr_read_proc:
c4_read_proc
,
driver_read_proc:
0
,
/* use standard driver_read_proc */
add_card:
0
,
/* no add_card function */
owner:
THIS_MODULE
,
name:
"c2"
,
revision:
"0.0"
,
load_firmware:
c4_load_firmware
,
reset_ctr:
c4_reset_ctr
,
remove_ctr:
c4_remove_ctr
,
register_appl:
c4_register_appl
,
release_appl:
c4_release_appl
,
send_message:
c4_send_message
,
procinfo:
c4_procinfo
,
ctr_read_proc:
c4_read_proc
,
driver_read_proc:
0
,
/* use standard driver_read_proc */
add_card:
0
,
/* no add_card function */
};
static
struct
capi_driver
c4_driver
=
{
name:
"c4"
,
revision:
"0.0"
,
load_firmware:
c4_load_firmware
,
reset_ctr:
c4_reset_ctr
,
remove_ctr:
c4_remove_ctr
,
register_appl:
c4_register_appl
,
release_appl:
c4_release_appl
,
send_message:
c4_send_message
,
procinfo:
c4_procinfo
,
ctr_read_proc:
c4_read_proc
,
driver_read_proc:
0
,
/* use standard driver_read_proc */
add_card:
0
,
/* no add_card function */
owner:
THIS_MODULE
,
name:
"c4"
,
revision:
"0.0"
,
load_firmware:
c4_load_firmware
,
reset_ctr:
c4_reset_ctr
,
remove_ctr:
c4_remove_ctr
,
register_appl:
c4_register_appl
,
release_appl:
c4_release_appl
,
send_message:
c4_send_message
,
procinfo:
c4_procinfo
,
ctr_read_proc:
c4_read_proc
,
driver_read_proc:
0
,
/* use standard driver_read_proc */
add_card:
0
,
/* no add_card function */
};
static
int
c4_attach_driver
(
struct
capi_driver
*
driver
)
...
...
@@ -1253,13 +1243,7 @@ static int c4_attach_driver (struct capi_driver * driver)
printk
(
KERN_INFO
"%s: revision %s
\n
"
,
driver
->
name
,
driver
->
revision
);
di
=
attach_capi_driver
(
driver
);
if
(
!
di
)
{
printk
(
KERN_ERR
"%s: failed to attach capi_driver
\n
"
,
driver
->
name
);
MOD_DEC_USE_COUNT
;
return
-
ENODEV
;
}
attach_capi_driver
(
driver
);
return
0
;
}
...
...
drivers/isdn/hardware/avm/t1isa.c
View file @
06082418
...
...
@@ -35,10 +35,6 @@ MODULE_LICENSE("GPL");
/* ------------------------------------------------------------- */
static
struct
capi_driver_interface
*
di
;
/* ------------------------------------------------------------- */
static
int
hema_irq_table
[
16
]
=
{
0
,
0
,
...
...
@@ -199,7 +195,7 @@ static void t1isa_interrupt(int interrupt, void *devptr, struct pt_regs *regs)
if
(
NCCI
!=
0xffffffff
)
ctrl
->
free_ncci
(
ctrl
,
ApplId
,
NCCI
);
else
ctrl
->
appl_released
(
ctrl
,
ApplId
);
break
;
case
RECEIVE_START
:
...
...
@@ -331,7 +327,7 @@ static void t1isa_remove_ctr(struct capi_ctr *ctrl)
b1_reset
(
port
);
t1_reset
(
port
);
d
i
->
detach
_ctr
(
ctrl
);
d
etach_capi
_ctr
(
ctrl
);
free_irq
(
card
->
irq
,
card
);
release_region
(
card
->
port
,
AVMB1_PORTLEN
);
b1_free_card
(
card
);
...
...
@@ -344,6 +340,7 @@ static void t1isa_remove_ctr(struct capi_ctr *ctrl)
static
int
t1isa_add_card
(
struct
capi_driver
*
driver
,
struct
capicardparams
*
p
)
{
struct
capi_ctr
*
ctrl
;
struct
list_head
*
l
;
avmctrl_info
*
cinfo
;
avmcard
*
card
;
int
retval
;
...
...
@@ -376,8 +373,11 @@ static int t1isa_add_card(struct capi_driver *driver, struct capicardparams *p)
retval
=
-
EINVAL
;
goto
err_free
;
}
for
(
ctrl
=
driver
->
controller
;
ctrl
;
ctrl
=
ctrl
->
next
)
{
avmcard
*
cardp
=
((
avmctrl_info
*
)(
ctrl
->
driverdata
))
->
card
;
list_for_each
(
l
,
&
driver
->
contr_head
)
{
avmcard
*
cardp
;
ctrl
=
list_entry
(
l
,
struct
capi_ctr
,
driver_list
);
cardp
=
((
avmctrl_info
*
)(
ctrl
->
driverdata
))
->
card
;
if
(
cardp
->
cardnr
==
card
->
cardnr
)
{
printk
(
KERN_WARNING
"%s: card with number %d already installed at 0x%x.
\n
"
,
driver
->
name
,
card
->
cardnr
,
cardp
->
port
);
...
...
@@ -408,7 +408,7 @@ static int t1isa_add_card(struct capi_driver *driver, struct capicardparams *p)
t1_disable_irq
(
card
->
port
);
b1_reset
(
card
->
port
);
cinfo
->
capi_ctrl
=
di
->
attach
_ctr
(
driver
,
card
->
name
,
cinfo
);
cinfo
->
capi_ctrl
=
attach_capi
_ctr
(
driver
,
card
->
name
,
cinfo
);
if
(
!
cinfo
->
capi_ctrl
)
{
printk
(
KERN_ERR
"%s: attach controller failed.
\n
"
,
driver
->
name
);
...
...
@@ -479,20 +479,21 @@ static char *t1isa_procinfo(struct capi_ctr *ctrl)
/* ------------------------------------------------------------- */
static
struct
capi_driver
t1isa_driver
=
{
name:
"t1isa"
,
revision:
"0.0"
,
load_firmware:
t1isa_load_firmware
,
reset_ctr:
t1isa_reset_ctr
,
remove_ctr:
t1isa_remove_ctr
,
register_appl:
b1_register_appl
,
release_appl:
b1_release_appl
,
send_message:
t1isa_send_message
,
procinfo:
t1isa_procinfo
,
ctr_read_proc:
b1ctl_read_proc
,
driver_read_proc:
0
,
/* use standard driver_read_proc */
add_card:
t1isa_add_card
,
owner:
THIS_MODULE
,
name:
"t1isa"
,
revision:
"0.0"
,
load_firmware:
t1isa_load_firmware
,
reset_ctr:
t1isa_reset_ctr
,
remove_ctr:
t1isa_remove_ctr
,
register_appl:
b1_register_appl
,
release_appl:
b1_release_appl
,
send_message:
t1isa_send_message
,
procinfo:
t1isa_procinfo
,
ctr_read_proc:
b1ctl_read_proc
,
driver_read_proc:
0
,
/* use standard driver_read_proc */
add_card:
t1isa_add_card
,
};
static
int
__init
t1isa_init
(
void
)
...
...
@@ -512,13 +513,7 @@ static int __init t1isa_init(void)
printk
(
KERN_INFO
"%s: revision %s
\n
"
,
driver
->
name
,
driver
->
revision
);
di
=
attach_capi_driver
(
driver
);
if
(
!
di
)
{
printk
(
KERN_ERR
"%s: failed to attach capi_driver
\n
"
,
driver
->
name
);
retval
=
-
EIO
;
}
attach_capi_driver
(
driver
);
MOD_DEC_USE_COUNT
;
return
retval
;
...
...
drivers/isdn/hardware/avm/t1pci.c
View file @
06082418
...
...
@@ -45,10 +45,6 @@ MODULE_LICENSE("GPL");
/* ------------------------------------------------------------- */
static
struct
capi_driver_interface
*
di
;
/* ------------------------------------------------------------- */
static
int
t1pci_add_card
(
struct
capi_driver
*
driver
,
struct
capicardparams
*
p
,
struct
pci_dev
*
dev
)
...
...
@@ -119,7 +115,7 @@ static int t1pci_add_card(struct capi_driver *driver,
goto
err_unmap
;
}
cinfo
->
capi_ctrl
=
di
->
attach
_ctr
(
driver
,
card
->
name
,
cinfo
);
cinfo
->
capi_ctrl
=
attach_capi
_ctr
(
driver
,
card
->
name
,
cinfo
);
if
(
!
cinfo
->
capi_ctrl
)
{
printk
(
KERN_ERR
"%s: attach controller failed.
\n
"
,
driver
->
name
);
retval
=
-
EBUSY
;
...
...
@@ -157,7 +153,7 @@ static void t1pci_remove_ctr(struct capi_ctr *ctrl)
b1dma_reset
(
card
);
d
i
->
detach
_ctr
(
ctrl
);
d
etach_capi
_ctr
(
ctrl
);
free_irq
(
card
->
irq
,
card
);
iounmap
(
card
->
mbase
);
release_region
(
card
->
port
,
AVMB1_PORTLEN
);
...
...
@@ -189,20 +185,21 @@ static char *t1pci_procinfo(struct capi_ctr *ctrl)
/* ------------------------------------------------------------- */
static
struct
capi_driver
t1pci_driver
=
{
name:
"t1pci"
,
revision:
"0.0"
,
load_firmware:
b1dma_load_firmware
,
reset_ctr:
b1dma_reset_ctr
,
remove_ctr:
t1pci_remove_ctr
,
register_appl:
b1dma_register_appl
,
release_appl:
b1dma_release_appl
,
send_message:
b1dma_send_message
,
procinfo:
t1pci_procinfo
,
ctr_read_proc:
b1dmactl_read_proc
,
driver_read_proc:
0
,
/* use standard driver_read_proc */
add_card:
0
,
/* no add_card function */
owner:
THIS_MODULE
,
name:
"t1pci"
,
revision:
"0.0"
,
load_firmware:
b1dma_load_firmware
,
reset_ctr:
b1dma_reset_ctr
,
remove_ctr:
t1pci_remove_ctr
,
register_appl:
b1dma_register_appl
,
release_appl:
b1dma_release_appl
,
send_message:
b1dma_send_message
,
procinfo:
t1pci_procinfo
,
ctr_read_proc:
b1dmactl_read_proc
,
driver_read_proc:
0
,
/* use standard driver_read_proc */
add_card:
0
,
/* no add_card function */
};
/* ------------------------------------------------------------- */
...
...
@@ -261,13 +258,7 @@ static int __init t1pci_init(void)
printk
(
KERN_INFO
"%s: revision %s
\n
"
,
driver
->
name
,
driver
->
revision
);
di
=
attach_capi_driver
(
&
t1pci_driver
);
if
(
!
di
)
{
printk
(
KERN_ERR
"%s: failed to attach capi_driver
\n
"
,
driver
->
name
);
MOD_DEC_USE_COUNT
;
return
-
EIO
;
}
attach_capi_driver
(
&
t1pci_driver
);
ncards
=
pci_register_driver
(
&
t1pci_pci_driver
);
if
(
ncards
)
{
...
...
drivers/isdn/hysdn/hycapi.c
View file @
06082418
...
...
@@ -98,7 +98,7 @@ hycapi_remove_ctr(struct capi_ctr *ctrl)
hycapi_applications
[
i
].
listen_req
[
ctrl
->
cnr
-
1
]
=
NULL
;
}
}
hy_di
->
detach
_ctr
(
ctrl
);
detach_capi
_ctr
(
ctrl
);
ctrl
->
driverdata
=
0
;
kfree
(
card
->
hyctrlinfo
);
...
...
@@ -252,7 +252,6 @@ hycapi_register_appl(struct capi_ctr *ctrl, __u16 appl,
rp
,
sizeof
(
capi_register_params
));
/* MOD_INC_USE_COUNT; */
ctrl
->
appl_registered
(
ctrl
,
appl
);
}
/*********************************************************************
...
...
@@ -313,7 +312,6 @@ hycapi_release_appl(struct capi_ctr *ctrl, __u16 appl)
{
hycapi_release_internal
(
ctrl
,
appl
);
}
ctrl
->
appl_released
(
ctrl
,
appl
);
/* MOD_DEC_USE_COUNT; */
}
...
...
@@ -666,18 +664,21 @@ hycapi_tx_capiget(hysdn_card *card)
static
struct
capi_driver
hycapi_driver
=
{
"hysdn"
,
"0.0"
,
hycapi_load_firmware
,
hycapi_reset_ctr
,
hycapi_remove_ctr
,
hycapi_register_appl
,
hycapi_release_appl
,
hycapi_send_message
,
hycapi_procinfo
,
hycapi_read_proc
,
0
,
/* use standard driver_read_proc */
0
,
/* no add_card function */
owner:
THIS_MODULE
,
name:
"hysdn"
,
revision:
"0.0"
,
load_firmware:
hycapi_load_firmware
,
reset_ctr:
hycapi_reset_ctr
,
remove_ctr:
hycapi_remove_ctr
,
register_appl:
hycapi_register_appl
,
release_appl:
hycapi_release_appl
,
send_message:
hycapi_send_message
,
procinfo:
hycapi_procinfo
,
ctr_read_proc:
hycapi_read_proc
,
driver_read_proc:
0
,
/* use standard driver_read_proc */
add_card:
0
,
/* no add_card function */
};
...
...
@@ -698,11 +699,8 @@ int hycapi_init()
}
driver
=
&
hycapi_driver
;
printk
(
KERN_NOTICE
"HYSDN: Attaching capi-driver
\n
"
);
hy_di
=
attach_capi_driver
(
driver
);
if
(
!
hy_di
)
{
printk
(
KERN_ERR
"HYCAPI: failed to attach capi_driver
\n
"
);
return
(
-
1
);
}
attach_capi_driver
(
driver
);
for
(
i
=
0
;
i
<
CAPI_MAXAPPL
;
i
++
)
{
memset
(
&
(
hycapi_applications
[
i
]),
0
,
sizeof
(
hycapi_appl
));
}
...
...
@@ -798,8 +796,8 @@ hycapi_capi_create(hysdn_card *card)
default:
strcpy
(
cinfo
->
cardname
,
"HYSDN ???"
);
break
;
}
cinfo
->
capi_ctrl
=
hy_di
->
attach
_ctr
(
&
hycapi_driver
,
cinfo
->
cardname
,
cinfo
);
cinfo
->
capi_ctrl
=
attach_capi
_ctr
(
&
hycapi_driver
,
cinfo
->
cardname
,
cinfo
);
ctrl
=
cinfo
->
capi_ctrl
;
if
(
!
ctrl
)
{
printk
(
KERN_ERR
"%s: attach controller failed.
\n
"
,
...
...
include/linux/isdn/capidev.h
deleted
100644 → 0
View file @
56677816
/* $Id: capidev.h,v 1.6.6.2 2001/09/23 22:24:33 kai Exp $
*
* CAPI 2.0 Interface for Linux
*
* Copyright 1996 by Carsten Paeth <calle@calle.de>
*
* This software may be used and distributed according to the terms
* of the GNU General Public License, incorporated herein by reference.
*
*/
struct
capidev
{
struct
capidev
*
next
;
struct
file
*
file
;
__u16
applid
;
__u16
errcode
;
unsigned
int
minor
;
struct
sk_buff_head
recv_queue
;
wait_queue_head_t
recv_wait
;
/* Statistic */
unsigned
long
nrecvctlpkt
;
unsigned
long
nrecvdatapkt
;
unsigned
long
nsentctlpkt
;
unsigned
long
nsentdatapkt
;
};
include/linux/isdn/capilli.h
View file @
06082418
...
...
@@ -12,6 +12,8 @@
#ifndef __CAPILLI_H__
#define __CAPILLI_H__
#include <linux/list.h>
typedef
struct
capiloaddatapart
{
int
user
;
/* data in userspace ? */
int
len
;
...
...
@@ -34,7 +36,7 @@ typedef struct capicardparams {
struct
capi_driver
;
struct
capi_ctr
{
struct
capi_ctr
*
next
;
/* next ctr of same
driver */
struct
list_head
driver_list
;
/* contrs by
driver */
struct
capi_driver
*
driver
;
int
cnr
;
/* controller number */
char
name
[
32
];
/* name of controller */
...
...
@@ -57,8 +59,6 @@ struct capi_ctr {
void
(
*
resume_output
)(
struct
capi_ctr
*
card
);
void
(
*
handle_capimsg
)(
struct
capi_ctr
*
card
,
__u16
appl
,
struct
sk_buff
*
skb
);
void
(
*
appl_registered
)(
struct
capi_ctr
*
card
,
__u16
appl
);
void
(
*
appl_released
)(
struct
capi_ctr
*
card
,
__u16
appl
);
void
(
*
new_ncci
)(
struct
capi_ctr
*
card
,
__u16
appl
,
__u32
ncci
,
__u32
winsize
);
...
...
@@ -75,39 +75,38 @@ struct capi_ctr {
char
procfn
[
128
];
};
struct
capi_driver_interface
{
struct
capi_ctr
*
(
*
attach_ctr
)(
struct
capi_driver
*
driver
,
char
*
name
,
void
*
data
);
int
(
*
detach_ctr
)(
struct
capi_ctr
*
);
};
struct
capi_driver
{
char
name
[
32
];
/* driver name */
char
revision
[
32
];
int
(
*
load_firmware
)(
struct
capi_ctr
*
,
capiloaddata
*
);
void
(
*
reset_ctr
)(
struct
capi_ctr
*
);
void
(
*
remove_ctr
)(
struct
capi_ctr
*
);
void
(
*
register_appl
)(
struct
capi_ctr
*
,
__u16
appl
,
capi_register_params
*
);
void
(
*
release_appl
)(
struct
capi_ctr
*
,
__u16
appl
);
void
(
*
send_message
)(
struct
capi_ctr
*
,
struct
sk_buff
*
skb
);
char
*
(
*
procinfo
)(
struct
capi_ctr
*
);
int
(
*
ctr_read_proc
)(
char
*
page
,
char
**
start
,
off_t
off
,
int
count
,
int
*
eof
,
struct
capi_ctr
*
card
);
int
(
*
driver_read_proc
)(
char
*
page
,
char
**
start
,
off_t
off
,
int
count
,
int
*
eof
,
struct
capi_driver
*
driver
);
int
(
*
add_card
)(
struct
capi_driver
*
driver
,
capicardparams
*
data
);
/* intitialized by kcapi */
struct
capi_ctr
*
controller
;
/* list of controllers */
struct
capi_driver
*
next
;
int
ncontroller
;
struct
proc_dir_entry
*
procent
;
char
procfn
[
128
];
struct
module
*
owner
;
char
name
[
32
];
/* driver name */
char
revision
[
32
];
int
(
*
load_firmware
)(
struct
capi_ctr
*
,
capiloaddata
*
);
void
(
*
reset_ctr
)(
struct
capi_ctr
*
);
void
(
*
remove_ctr
)(
struct
capi_ctr
*
);
void
(
*
register_appl
)(
struct
capi_ctr
*
,
__u16
appl
,
capi_register_params
*
);
void
(
*
release_appl
)(
struct
capi_ctr
*
,
__u16
appl
);
void
(
*
send_message
)(
struct
capi_ctr
*
,
struct
sk_buff
*
skb
);
char
*
(
*
procinfo
)(
struct
capi_ctr
*
);
int
(
*
ctr_read_proc
)(
char
*
page
,
char
**
start
,
off_t
off
,
int
count
,
int
*
eof
,
struct
capi_ctr
*
card
);
int
(
*
driver_read_proc
)(
char
*
page
,
char
**
start
,
off_t
off
,
int
count
,
int
*
eof
,
struct
capi_driver
*
driver
);
int
(
*
add_card
)(
struct
capi_driver
*
driver
,
capicardparams
*
data
);
/* intitialized by kcapi */
struct
list_head
contr_head
;
/* list of controllers */
struct
list_head
driver_list
;
int
ncontroller
;
struct
proc_dir_entry
*
procent
;
char
procfn
[
128
];
};
struct
capi_driver_interface
*
attach_capi_driver
(
struct
capi_driver
*
driver
);
void
attach_capi_driver
(
struct
capi_driver
*
driver
);
void
detach_capi_driver
(
struct
capi_driver
*
driver
);
struct
capi_ctr
*
attach_capi_ctr
(
struct
capi_driver
*
driver
,
char
*
name
,
void
*
data
);
int
detach_capi_ctr
(
struct
capi_ctr
*
);
#endif
/* __CAPILLI_H__ */
include/linux/kernelcapi.h
View file @
06082418
...
...
@@ -10,6 +10,8 @@
#ifndef __KERNELCAPI_H__
#define __KERNELCAPI_H__
#include <linux/list.h>
#define CAPI_MAXAPPL 128
/* maximum number of applications */
#define CAPI_MAXCONTR 16
/* maximum number of controller */
#define CAPI_MAXDATAWINDOW 8
...
...
@@ -81,7 +83,7 @@ struct capi_interface_user {
char
name
[
20
];
void
(
*
callback
)
(
unsigned
int
cmd
,
__u32
contr
,
void
*
data
);
/* internal */
struct
capi_interface_user
*
nex
t
;
struct
list_head
user_lis
t
;
};
struct
capi_interface
*
attach_capi_interface
(
struct
capi_interface_user
*
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment