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
2c684c75
Commit
2c684c75
authored
Sep 08, 2003
by
Armin Schindler
Committed by
Linus Torvalds
Sep 08, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] eicon ISDN driver: list handling
Fixed internel list handling for modules built-in kernel.
parent
0c8d50b6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
44 deletions
+23
-44
drivers/isdn/hardware/eicon/dlist.c
drivers/isdn/hardware/eicon/dlist.c
+7
-29
drivers/isdn/hardware/eicon/dlist.h
drivers/isdn/hardware/eicon/dlist.h
+1
-13
drivers/isdn/hardware/eicon/um_idi.c
drivers/isdn/hardware/eicon/um_idi.c
+15
-2
No files found.
drivers/isdn/hardware/eicon/dlist.c
View file @
2c684c75
/* $Id: dlist.c,v 1.
1.2.2 2001/02/11 14:40:41 armin
Exp $ */
/* $Id: dlist.c,v 1.
6 2003/08/25 16:03:35 schindler
Exp $ */
#include "platform.h"
#include "platform.h"
#include "dlist.h"
#include "dlist.h"
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
** Initialize linked list
** Initialize linked list
*/
*/
void
diva_q_init
(
diva_entity_queue_t
*
q
)
static
void
diva_q_init
(
diva_entity_queue_t
*
q
)
{
{
memset
(
q
,
0x00
,
sizeof
(
*
q
));
memset
(
q
,
0x00
,
sizeof
(
*
q
));
}
}
...
@@ -15,7 +15,7 @@ void diva_q_init(diva_entity_queue_t * q)
...
@@ -15,7 +15,7 @@ void diva_q_init(diva_entity_queue_t * q)
/*
/*
** Remove element from linked list
** Remove element from linked list
*/
*/
void
diva_q_remove
(
diva_entity_queue_t
*
q
,
diva_entity_link_t
*
what
)
static
void
diva_q_remove
(
diva_entity_queue_t
*
q
,
diva_entity_link_t
*
what
)
{
{
if
(
!
what
->
prev
)
{
if
(
!
what
->
prev
)
{
if
((
q
->
head
=
what
->
next
))
{
if
((
q
->
head
=
what
->
next
))
{
...
@@ -36,7 +36,7 @@ void diva_q_remove(diva_entity_queue_t * q, diva_entity_link_t * what)
...
@@ -36,7 +36,7 @@ void diva_q_remove(diva_entity_queue_t * q, diva_entity_link_t * what)
/*
/*
** Add element to the tail of linked list
** Add element to the tail of linked list
*/
*/
void
diva_q_add_tail
(
diva_entity_queue_t
*
q
,
diva_entity_link_t
*
what
)
static
void
diva_q_add_tail
(
diva_entity_queue_t
*
q
,
diva_entity_link_t
*
what
)
{
{
what
->
next
=
0
;
what
->
next
=
0
;
if
(
!
q
->
head
)
{
if
(
!
q
->
head
)
{
...
@@ -49,7 +49,7 @@ void diva_q_add_tail(diva_entity_queue_t * q, diva_entity_link_t * what)
...
@@ -49,7 +49,7 @@ void diva_q_add_tail(diva_entity_queue_t * q, diva_entity_link_t * what)
}
}
}
}
diva_entity_link_t
*
diva_q_find
(
const
diva_entity_queue_t
*
q
,
static
diva_entity_link_t
*
diva_q_find
(
const
diva_entity_queue_t
*
q
,
const
void
*
what
,
diva_q_cmp_fn_t
cmp_fn
)
const
void
*
what
,
diva_q_cmp_fn_t
cmp_fn
)
{
{
diva_entity_link_t
*
diva_current
=
q
->
head
;
diva_entity_link_t
*
diva_current
=
q
->
head
;
...
@@ -64,35 +64,13 @@ diva_entity_link_t *diva_q_find(const diva_entity_queue_t * q,
...
@@ -64,35 +64,13 @@ diva_entity_link_t *diva_q_find(const diva_entity_queue_t * q,
return
(
diva_current
);
return
(
diva_current
);
}
}
diva_entity_link_t
*
diva_q_get_head
(
diva_entity_queue_t
*
q
)
static
diva_entity_link_t
*
diva_q_get_head
(
diva_entity_queue_t
*
q
)
{
{
return
(
q
->
head
);
return
(
q
->
head
);
}
}
diva_entity_link_t
*
diva_q_get_tail
(
diva_entity_queue_t
*
q
)
static
diva_entity_link_t
*
diva_q_get_next
(
diva_entity_link_t
*
what
)
{
return
(
q
->
tail
);
}
diva_entity_link_t
*
diva_q_get_next
(
diva_entity_link_t
*
what
)
{
{
return
((
what
)
?
what
->
next
:
0
);
return
((
what
)
?
what
->
next
:
0
);
}
}
diva_entity_link_t
*
diva_q_get_prev
(
diva_entity_link_t
*
what
)
{
return
((
what
)
?
what
->
prev
:
0
);
}
int
diva_q_get_nr_of_entries
(
const
diva_entity_queue_t
*
q
)
{
int
i
=
0
;
const
diva_entity_link_t
*
diva_current
=
q
->
head
;
while
(
diva_current
)
{
i
++
;
diva_current
=
diva_current
->
next
;
}
return
(
i
);
}
drivers/isdn/hardware/eicon/dlist.h
View file @
2c684c75
/* $Id: dlist.h,v 1.
1.2.2 2001/02/08 12:25:43 armin
Exp $ */
/* $Id: dlist.h,v 1.
5 2003/08/25 16:03:35 schindler
Exp $ */
#ifndef __DIVA_LINK_H__
#ifndef __DIVA_LINK_H__
#define __DIVA_LINK_H__
#define __DIVA_LINK_H__
...
@@ -17,16 +17,4 @@ typedef struct _diva_entity_queue {
...
@@ -17,16 +17,4 @@ typedef struct _diva_entity_queue {
typedef
int
(
*
diva_q_cmp_fn_t
)
(
const
void
*
what
,
typedef
int
(
*
diva_q_cmp_fn_t
)
(
const
void
*
what
,
const
diva_entity_link_t
*
);
const
diva_entity_link_t
*
);
void
diva_q_remove
(
diva_entity_queue_t
*
q
,
diva_entity_link_t
*
what
);
void
diva_q_add_tail
(
diva_entity_queue_t
*
q
,
diva_entity_link_t
*
what
);
diva_entity_link_t
*
diva_q_find
(
const
diva_entity_queue_t
*
q
,
const
void
*
what
,
diva_q_cmp_fn_t
cmp_fn
);
diva_entity_link_t
*
diva_q_get_head
(
diva_entity_queue_t
*
q
);
diva_entity_link_t
*
diva_q_get_tail
(
diva_entity_queue_t
*
q
);
diva_entity_link_t
*
diva_q_get_next
(
diva_entity_link_t
*
what
);
diva_entity_link_t
*
diva_q_get_prev
(
diva_entity_link_t
*
what
);
int
diva_q_get_nr_of_entries
(
const
diva_entity_queue_t
*
q
);
void
diva_q_init
(
diva_entity_queue_t
*
q
);
#endif
#endif
drivers/isdn/hardware/eicon/um_idi.c
View file @
2c684c75
/* $Id: um_idi.c,v 1.
1.2.2 2001/02/11 14:40:41 armin
Exp $ */
/* $Id: um_idi.c,v 1.
9 2003/09/09 06:00:47 schindler
Exp $ */
#include "platform.h"
#include "platform.h"
#include "di_defs.h"
#include "di_defs.h"
...
@@ -37,6 +37,11 @@ static int process_idi_rc(divas_um_idi_entity_t * e, byte rc);
...
@@ -37,6 +37,11 @@ static int process_idi_rc(divas_um_idi_entity_t * e, byte rc);
static
int
process_idi_ind
(
divas_um_idi_entity_t
*
e
,
byte
ind
);
static
int
process_idi_ind
(
divas_um_idi_entity_t
*
e
,
byte
ind
);
static
int
write_return_code
(
divas_um_idi_entity_t
*
e
,
byte
rc
);
static
int
write_return_code
(
divas_um_idi_entity_t
*
e
,
byte
rc
);
/*
* include queue functions
*/
#include "dlist.c"
/* --------------------------------------------------------------------------
/* --------------------------------------------------------------------------
MAIN
MAIN
-------------------------------------------------------------------------- */
-------------------------------------------------------------------------- */
...
@@ -171,7 +176,15 @@ static diva_um_idi_adapter_t *diva_um_idi_find_adapter(dword nr)
...
@@ -171,7 +176,15 @@ static diva_um_idi_adapter_t *diva_um_idi_find_adapter(dword nr)
------------------------------------------------------------------------ */
------------------------------------------------------------------------ */
int
diva_um_idi_nr_of_adapters
(
void
)
int
diva_um_idi_nr_of_adapters
(
void
)
{
{
return
(
diva_q_get_nr_of_entries
(
&
adapter_q
));
int
i
=
0
;
const
diva_entity_queue_t
*
q
=
&
adapter_q
;
const
diva_entity_link_t
*
diva_current
=
q
->
head
;
while
(
diva_current
)
{
i
++
;
diva_current
=
diva_current
->
next
;
}
return
(
i
);
}
}
/* ------------------------------------------------------------------------
/* ------------------------------------------------------------------------
...
...
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