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
nexedi
linux
Commits
c1c5774f
Commit
c1c5774f
authored
May 11, 2002
by
Kai Germaschewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ISDN: AVM CAPI drivers: Common revision parsing
Use common function for setting the revision strings.
parent
2e025886
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
42 additions
and
102 deletions
+42
-102
drivers/isdn/hardware/avm/avmcard.h
drivers/isdn/hardware/avm/avmcard.h
+1
-1
drivers/isdn/hardware/avm/b1.c
drivers/isdn/hardware/avm/b1.c
+16
-0
drivers/isdn/hardware/avm/b1isa.c
drivers/isdn/hardware/avm/b1isa.c
+2
-12
drivers/isdn/hardware/avm/b1pci.c
drivers/isdn/hardware/avm/b1pci.c
+9
-30
drivers/isdn/hardware/avm/b1pcmcia.c
drivers/isdn/hardware/avm/b1pcmcia.c
+3
-15
drivers/isdn/hardware/avm/c4.c
drivers/isdn/hardware/avm/c4.c
+5
-17
drivers/isdn/hardware/avm/t1isa.c
drivers/isdn/hardware/avm/t1isa.c
+4
-16
drivers/isdn/hardware/avm/t1pci.c
drivers/isdn/hardware/avm/t1pci.c
+2
-11
No files found.
drivers/isdn/hardware/avm/avmcard.h
View file @
c1c5774f
...
...
@@ -537,6 +537,7 @@ static inline void b1_setinterrupt(unsigned int base, unsigned irq,
}
/* b1.c */
void
b1_set_revision
(
struct
capi_driver
*
driver
,
char
*
rev
);
avmcard
*
b1_alloc_card
(
int
nr_controllers
);
void
b1_free_card
(
avmcard
*
card
);
int
b1_detect
(
unsigned
int
base
,
enum
avmcardtype
cardtype
);
...
...
@@ -561,7 +562,6 @@ avmcard_dmainfo *avmcard_dma_alloc(char *name, struct pci_dev *,
long
rsize
,
long
ssize
);
void
avmcard_dma_free
(
avmcard_dmainfo
*
);
/* b1dma.c */
int
b1pciv4_detect
(
avmcard
*
card
);
int
t1pci_detect
(
avmcard
*
card
);
...
...
drivers/isdn/hardware/avm/b1.c
View file @
c1c5774f
...
...
@@ -59,6 +59,21 @@ int b1_irq_table[16] =
/* ------------------------------------------------------------- */
void
b1_set_revision
(
struct
capi_driver
*
driver
,
char
*
rev
)
{
char
*
p
;
if
((
p
=
strchr
(
rev
,
':'
))
!=
0
&&
p
[
1
])
{
strncpy
(
driver
->
revision
,
p
+
2
,
sizeof
(
driver
->
revision
));
driver
->
revision
[
sizeof
(
driver
->
revision
)
-
1
]
=
0
;
if
((
p
=
strchr
(
driver
->
revision
,
'$'
))
!=
0
&&
p
>
driver
->
revision
)
*
(
p
-
1
)
=
0
;
}
printk
(
KERN_INFO
"%s: revision %s
\n
"
,
driver
->
name
,
driver
->
revision
);
}
/* ------------------------------------------------------------- */
avmcard
*
b1_alloc_card
(
int
nr_controllers
)
{
avmcard
*
card
;
...
...
@@ -763,6 +778,7 @@ EXPORT_SYMBOL(avmcard_dma_free);
EXPORT_SYMBOL
(
b1_irq_table
);
EXPORT_SYMBOL
(
b1_set_revision
);
EXPORT_SYMBOL
(
b1_alloc_card
);
EXPORT_SYMBOL
(
b1_free_card
);
EXPORT_SYMBOL
(
b1_detect
);
...
...
drivers/isdn/hardware/avm/b1isa.c
View file @
c1c5774f
...
...
@@ -164,21 +164,11 @@ static struct capi_driver b1isa_driver = {
static
int
__init
b1isa_init
(
void
)
{
struct
capi_driver
*
driver
=
&
b1isa_driver
;
char
*
p
;
MOD_INC_USE_COUNT
;
if
((
p
=
strchr
(
revision
,
':'
))
!=
0
&&
p
[
1
])
{
strncpy
(
driver
->
revision
,
p
+
2
,
sizeof
(
driver
->
revision
));
driver
->
revision
[
sizeof
(
driver
->
revision
)
-
1
]
=
0
;
if
((
p
=
strchr
(
driver
->
revision
,
'$'
))
!=
0
&&
p
>
driver
->
revision
)
*
(
p
-
1
)
=
0
;
}
printk
(
KERN_INFO
"%s: revision %s
\n
"
,
driver
->
name
,
driver
->
revision
);
b1_set_revision
(
&
b1isa_driver
,
revision
);
attach_capi_driver
(
&
b1isa_driver
);
attach_capi_driver
(
driver
);
MOD_DEC_USE_COUNT
;
return
0
;
}
...
...
drivers/isdn/hardware/avm/b1pci.c
View file @
c1c5774f
...
...
@@ -390,38 +390,16 @@ static struct pci_driver b1pci_pci_driver = {
static
int
__init
b1pci_init
(
void
)
{
struct
capi_driver
*
driver
=
&
b1pci_driver
;
#ifdef CONFIG_ISDN_DRV_AVMB1_B1PCIV4
struct
capi_driver
*
driverv4
=
&
b1pciv4_driver
;
#endif
char
*
p
;
int
retval
;
MOD_INC_USE_COUNT
;
if
((
p
=
strchr
(
revision
,
':'
))
!=
0
&&
p
[
1
])
{
strncpy
(
driver
->
revision
,
p
+
2
,
sizeof
(
driver
->
revision
));
driver
->
revision
[
sizeof
(
driver
->
revision
)
-
1
]
=
0
;
if
((
p
=
strchr
(
driver
->
revision
,
'$'
))
!=
0
&&
p
>
driver
->
revision
)
*
(
p
-
1
)
=
0
;
}
#ifdef CONFIG_ISDN_DRV_AVMB1_B1PCIV4
if
((
p
=
strchr
(
revision
,
':'
))
!=
0
&&
p
[
1
])
{
strncpy
(
driverv4
->
revision
,
p
+
2
,
sizeof
(
driverv4
->
revision
));
driverv4
->
revision
[
sizeof
(
driverv4
->
revision
)
-
1
]
=
0
;
if
((
p
=
strchr
(
driverv4
->
revision
,
'$'
))
!=
0
&&
p
>
driverv4
->
revision
)
*
(
p
-
1
)
=
0
;
}
#endif
printk
(
KERN_INFO
"%s: revision %s
\n
"
,
driver
->
name
,
driver
->
revision
);
attach_capi_driver
(
driver
);
b1_set_revision
(
&
b1pci_driver
,
revision
);
attach_capi_driver
(
&
b1pci_driver
);
#ifdef CONFIG_ISDN_DRV_AVMB1_B1PCIV4
printk
(
KERN_INFO
"%s: revision %s
\n
"
,
driverv4
->
name
,
driverv4
->
revision
);
attach_capi_driver
(
driverv4
);
b1_set_revision
(
&
b1pciv4_driver
,
revision
);
attach_capi_driver
(
&
b1pciv4_driver
);
#endif
retval
=
pci_module_init
(
&
b1pci_pci_driver
);
...
...
@@ -429,23 +407,24 @@ static int __init b1pci_init(void)
goto
err
;
printk
(
KERN_INFO
"%s: %d B1-PCI card(s) detected
\n
"
,
driver
->
name
,
retval
);
b1pci_driver
.
name
,
retval
);
retval
=
0
;
goto
out
;
err:
detach_capi_driver
(
driver
);
detach_capi_driver
(
&
b1pci_
driver
);
#ifdef CONFIG_ISDN_DRV_AVMB1_B1PCIV4
detach_capi_driver
(
driverv4
);
detach_capi_driver
(
&
b1pciv4_driver
);
#endif
out:
MOD_DEC_USE_COUNT
;
return
-
ENODEV
;
return
retval
;
}
static
void
__exit
b1pci_exit
(
void
)
{
pci_unregister_driver
(
&
b1pci_pci_driver
);
detach_capi_driver
(
&
b1pci_driver
);
#ifdef CONFIG_ISDN_DRV_AVMB1_B1PCIV4
detach_capi_driver
(
&
b1pciv4_driver
);
...
...
drivers/isdn/hardware/avm/b1pcmcia.c
View file @
c1c5774f
...
...
@@ -203,25 +203,13 @@ EXPORT_SYMBOL(b1pcmcia_delcard);
static
int
__init
b1pcmcia_init
(
void
)
{
struct
capi_driver
*
driver
=
&
b1pcmcia_driver
;
char
*
p
;
int
retval
=
0
;
MOD_INC_USE_COUNT
;
if
((
p
=
strchr
(
revision
,
':'
))
!=
0
&&
p
[
1
])
{
strncpy
(
driver
->
revision
,
p
+
2
,
sizeof
(
driver
->
revision
));
driver
->
revision
[
sizeof
(
driver
->
revision
)
-
1
]
=
0
;
if
((
p
=
strchr
(
driver
->
revision
,
'$'
))
!=
0
&&
p
>
driver
->
revision
)
*
(
p
-
1
)
=
0
;
}
printk
(
KERN_INFO
"%s: revision %s
\n
"
,
driver
->
name
,
driver
->
revision
);
attach_capi_driver
(
driver
);
b1_set_revision
(
&
b1pcmcia_driver
,
revision
);
attach_capi_driver
(
&
b1pcmcia_driver
);
MOD_DEC_USE_COUNT
;
return
retval
;
return
0
;
}
static
void
__exit
b1pcmcia_exit
(
void
)
...
...
drivers/isdn/hardware/avm/c4.c
View file @
c1c5774f
...
...
@@ -1245,21 +1245,6 @@ static struct capi_driver c4_driver = {
add_card:
0
,
/* no add_card function */
};
static
void
c4_attach_driver
(
struct
capi_driver
*
driver
)
{
char
*
p
;
if
((
p
=
strchr
(
revision
,
':'
))
!=
0
&&
p
[
1
])
{
strncpy
(
driver
->
revision
,
p
+
2
,
sizeof
(
driver
->
revision
));
driver
->
revision
[
sizeof
(
driver
->
revision
)
-
1
]
=
0
;
if
((
p
=
strchr
(
driver
->
revision
,
'$'
))
!=
0
&&
p
>
driver
->
revision
)
*
(
p
-
1
)
=
0
;
}
printk
(
KERN_INFO
"%s: revision %s
\n
"
,
driver
->
name
,
driver
->
revision
);
attach_capi_driver
(
driver
);
}
static
int
__devinit
c4_probe
(
struct
pci_dev
*
dev
,
const
struct
pci_device_id
*
ent
)
{
...
...
@@ -1305,8 +1290,11 @@ static int __init c4_init(void)
MOD_INC_USE_COUNT
;
c4_attach_driver
(
&
c4_driver
);
c4_attach_driver
(
&
c2_driver
);
b1_set_revision
(
&
c2_driver
,
revision
);
attach_capi_driver
(
&
c2_driver
);
b1_set_revision
(
&
c4_driver
,
revision
);
attach_capi_driver
(
&
c4_driver
);
retval
=
pci_module_init
(
&
c4_pci_driver
);
if
(
retval
<
0
)
...
...
drivers/isdn/hardware/avm/t1isa.c
View file @
c1c5774f
...
...
@@ -516,30 +516,18 @@ static struct capi_driver t1isa_driver = {
static
int
__init
t1isa_init
(
void
)
{
struct
capi_driver
*
driver
=
&
t1isa_driver
;
char
*
p
;
int
retval
=
0
;
MOD_INC_USE_COUNT
;
if
((
p
=
strchr
(
revision
,
':'
))
!=
0
&&
p
[
1
])
{
strncpy
(
driver
->
revision
,
p
+
2
,
sizeof
(
driver
->
revision
));
driver
->
revision
[
sizeof
(
driver
->
revision
)
-
1
]
=
0
;
if
((
p
=
strchr
(
driver
->
revision
,
'$'
))
!=
0
&&
p
>
driver
->
revision
)
*
(
p
-
1
)
=
0
;
}
printk
(
KERN_INFO
"%s: revision %s
\n
"
,
driver
->
name
,
driver
->
revision
);
attach_capi_driver
(
driver
);
b1_set_revision
(
&
t1isa_driver
,
revision
);
attach_capi_driver
(
&
t1isa_driver
);
MOD_DEC_USE_COUNT
;
return
retval
;
return
0
;
}
static
void
__exit
t1isa_exit
(
void
)
{
detach_capi_driver
(
&
t1isa_driver
);
detach_capi_driver
(
&
t1isa_driver
);
}
module_init
(
t1isa_init
);
...
...
drivers/isdn/hardware/avm/t1pci.c
View file @
c1c5774f
...
...
@@ -239,20 +239,11 @@ static struct pci_driver t1pci_pci_driver = {
static
int
__init
t1pci_init
(
void
)
{
struct
capi_driver
*
driver
=
&
t1pci_driver
;
char
*
p
;
int
retval
;
MOD_INC_USE_COUNT
;
if
((
p
=
strchr
(
revision
,
':'
))
!=
0
&&
p
[
1
])
{
strncpy
(
driver
->
revision
,
p
+
2
,
sizeof
(
driver
->
revision
)
-
1
);
if
((
p
=
strchr
(
driver
->
revision
,
'$'
))
!=
0
&&
p
>
driver
->
revision
)
*
(
p
-
1
)
=
0
;
}
printk
(
KERN_INFO
"%s: revision %s
\n
"
,
driver
->
name
,
driver
->
revision
);
b1_set_revision
(
&
t1pci_driver
,
revision
);
attach_capi_driver
(
&
t1pci_driver
);
retval
=
pci_register_driver
(
&
t1pci_pci_driver
);
...
...
@@ -260,7 +251,7 @@ static int __init t1pci_init(void)
goto
err
;
printk
(
KERN_INFO
"%s: %d T1-PCI card(s) detected
\n
"
,
driver
->
name
,
retval
);
t1pci_driver
.
name
,
retval
);
retval
=
0
;
goto
out
;
...
...
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