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
36dcfaba
Commit
36dcfaba
authored
Mar 11, 2002
by
Russell King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update Acorn serial drivers.
parent
1a4457da
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
60 additions
and
76 deletions
+60
-76
drivers/acorn/char/serial-atomwide.c
drivers/acorn/char/serial-atomwide.c
+0
-3
drivers/acorn/char/serial-card.c
drivers/acorn/char/serial-card.c
+60
-70
drivers/acorn/char/serial-dualsp.c
drivers/acorn/char/serial-dualsp.c
+0
-3
No files found.
drivers/acorn/char/serial-atomwide.c
View file @
36dcfaba
...
...
@@ -20,7 +20,4 @@
#define MY_PORT_ADDRESS(port,cardaddr) \
((cardaddr) + 0x200 - (port) * 0x100)
#define INIT serial_card_atomwide_init
#define EXIT serial_card_atomwide_exit
#include "serial-card.c"
drivers/acorn/char/serial-card.c
View file @
36dcfaba
...
...
@@ -29,6 +29,7 @@
#include <linux/types.h>
#include <linux/serial.h>
#include <linux/errno.h>
#include <linux/ioport.h>
#include <linux/init.h>
#include <asm/ecard.h>
...
...
@@ -38,95 +39,84 @@
#define NUM_SERIALS MY_NUMPORTS * MAX_ECARDS
#endif
#ifdef MODULE
static
int
__serial_ports
[
NUM_SERIALS
];
static
int
__serial_pcount
;
static
int
__serial_addr
[
NUM_SERIALS
];
static
int
serial_ports
[
NUM_SERIALS
];
static
int
serial_pcount
;
static
int
serial_addr
[
NUM_SERIALS
];
static
struct
expansion_card
*
expcard
[
MAX_ECARDS
];
#define ADD_ECARD(ec,card) expcard[(card)] = (ec)
#define ADD_PORT(port,addr) \
do { \
__serial_ports[__serial_pcount] = (port); \
__serial_addr[__serial_pcount] = (addr); \
__serial_pcount += 1; \
} while (0)
#else
#define ADD_ECARD(ec,card)
#define ADD_PORT(port,addr)
#endif
static
const
card_ids
serial_cids
[]
=
{
MY_CARD_LIST
,
{
0xffff
,
0xffff
}
};
static
inline
int
serial_register_onedev
(
unsigned
long
port
,
int
irq
)
{
struct
serial_struct
req
;
struct
serial_struct
req
;
memset
(
&
req
,
0
,
sizeof
(
req
));
req
.
baud_base
=
MY_BAUD_BASE
;
req
.
irq
=
irq
;
req
.
port
=
port
;
req
.
flags
=
0
;
memset
(
&
req
,
0
,
sizeof
(
req
));
req
.
baud_base
=
MY_BAUD_BASE
;
req
.
irq
=
irq
;
req
.
port
=
port
;
req
.
flags
=
0
;
return
register_serial
(
&
req
);
return
register_serial
(
&
req
);
}
static
int
__init
INIT
(
void
)
static
int
__init
serial_card_init
(
void
)
{
int
card
=
0
;
ecard_startfind
();
do
{
struct
expansion_card
*
ec
;
unsigned
long
cardaddr
;
int
port
;
ec
=
ecard_find
(
0
,
serial_cids
);
if
(
!
ec
)
break
;
cardaddr
=
MY_BASE_ADDRESS
(
ec
);
for
(
port
=
0
;
port
<
MY_NUMPORTS
;
port
++
)
{
unsigned
long
address
;
int
line
;
address
=
MY_PORT_ADDRESS
(
port
,
cardaddr
);
line
=
serial_register_onedev
(
address
,
ec
->
irq
);
if
(
line
<
0
)
break
;
ADD_PORT
(
line
,
address
);
}
if
(
port
)
{
ecard_claim
(
ec
);
ADD_ECARD
(
ec
,
card
);
}
else
break
;
}
while
(
++
card
<
MAX_ECARDS
);
return
card
?
0
:
-
ENODEV
;
int
card
=
0
;
ecard_startfind
();
do
{
struct
expansion_card
*
ec
;
unsigned
long
cardaddr
;
int
port
;
ec
=
ecard_find
(
0
,
serial_cids
);
if
(
!
ec
)
break
;
cardaddr
=
MY_BASE_ADDRESS
(
ec
);
for
(
port
=
0
;
port
<
MY_NUMPORTS
;
port
++
)
{
unsigned
long
address
;
int
line
;
address
=
MY_PORT_ADDRESS
(
port
,
cardaddr
);
line
=
serial_register_onedev
(
address
,
ec
->
irq
);
if
(
line
<
0
)
break
;
serial_ports
[
serial_pcount
]
=
line
;
serial_addr
[
serial_pcount
]
=
address
;
serial_pcount
+=
1
;
}
if
(
port
)
{
ecard_claim
(
ec
);
expcard
[
card
]
=
ec
;
}
else
break
;
}
while
(
++
card
<
MAX_ECARDS
);
return
card
?
0
:
-
ENODEV
;
}
static
void
__exit
EXIT
(
void
)
static
void
__exit
serial_card_exit
(
void
)
{
#ifdef MODULE
int
i
;
int
i
;
for
(
i
=
0
;
i
<
__
serial_pcount
;
i
++
)
{
unregister_serial
(
__
serial_ports
[
i
]);
release_region
(
__
serial_addr
[
i
],
8
);
}
for
(
i
=
0
;
i
<
serial_pcount
;
i
++
)
{
unregister_serial
(
serial_ports
[
i
]);
release_region
(
serial_addr
[
i
],
8
);
}
for
(
i
=
0
;
i
<
MAX_ECARDS
;
i
++
)
if
(
expcard
[
i
])
ecard_release
(
expcard
[
i
]);
#endif
for
(
i
=
0
;
i
<
MAX_ECARDS
;
i
++
)
if
(
expcard
[
i
])
ecard_release
(
expcard
[
i
]);
}
EXPORT_NO_SYMBOLS
;
MODULE_AUTHOR
(
"Russell King"
);
MODULE_LICENSE
(
"GPL"
);
module_init
(
INIT
);
module_exit
(
EXIT
);
module_init
(
serial_card_init
);
module_exit
(
serial_card_exit
);
drivers/acorn/char/serial-dualsp.c
View file @
36dcfaba
...
...
@@ -18,7 +18,4 @@
#define MY_PORT_ADDRESS(port,cardaddress) \
((cardaddress) + (port) * 8)
#define INIT serial_card_dualsp_init
#define EXIT serial_card_dualsp_exit
#include "serial-card.c"
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