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
ed06d524
Commit
ed06d524
authored
Jun 23, 2003
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Plain Diff
Merge
bk://bk.arm.linux.org.uk/linux-2.5-serial
into home.transmeta.com:/home/torvalds/v2.5/linux
parents
d255beb9
20052f47
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
50 deletions
+52
-50
drivers/serial/8250.c
drivers/serial/8250.c
+2
-2
drivers/serial/8250_cs.c
drivers/serial/8250_cs.c
+48
-46
drivers/serial/Kconfig
drivers/serial/Kconfig
+2
-2
No files found.
drivers/serial/8250.c
View file @
ed06d524
...
@@ -122,13 +122,13 @@ struct uart_8250_port {
...
@@ -122,13 +122,13 @@ struct uart_8250_port {
struct
uart_port
port
;
struct
uart_port
port
;
struct
timer_list
timer
;
/* "no irq" timer */
struct
timer_list
timer
;
/* "no irq" timer */
struct
list_head
list
;
/* ports on this IRQ */
struct
list_head
list
;
/* ports on this IRQ */
unsigned
short
rev
;
unsigned
char
acr
;
unsigned
char
acr
;
unsigned
char
ier
;
unsigned
char
ier
;
unsigned
char
rev
;
unsigned
char
lcr
;
unsigned
char
lcr
;
unsigned
char
mcr_mask
;
/* mask of user bits */
unsigned
char
mcr_mask
;
/* mask of user bits */
unsigned
char
mcr_force
;
/* mask of forced bits */
unsigned
char
mcr_force
;
/* mask of forced bits */
unsigned
int
lsr_break_flag
;
unsigned
char
lsr_break_flag
;
/*
/*
* We provide a per-port pm hook.
* We provide a per-port pm hook.
...
...
drivers/serial/8250_cs.c
View file @
ed06d524
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
A driver for PCMCIA serial devices
A driver for PCMCIA serial devices
serial_cs.c 1.1
23 2000/08/24 18:46:38
serial_cs.c 1.1
34 2002/05/04 05:48:53
The contents of this file are subject to the Mozilla Public
The contents of this file are subject to the Mozilla Public
License Version 1.1 (the "License"); you may not use this file
License Version 1.1 (the "License"); you may not use this file
...
@@ -43,7 +43,6 @@
...
@@ -43,7 +43,6 @@
#include <linux/serial.h>
#include <linux/serial.h>
#include <linux/serial_core.h>
#include <linux/serial_core.h>
#include <linux/major.h>
#include <linux/major.h>
#include <linux/workqueue.h>
#include <asm/io.h>
#include <asm/io.h>
#include <asm/system.h>
#include <asm/system.h>
...
@@ -59,7 +58,7 @@
...
@@ -59,7 +58,7 @@
static
int
pc_debug
=
PCMCIA_DEBUG
;
static
int
pc_debug
=
PCMCIA_DEBUG
;
MODULE_PARM
(
pc_debug
,
"i"
);
MODULE_PARM
(
pc_debug
,
"i"
);
#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args)
#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args)
static
char
*
version
=
"serial_cs.c 1.1
23 2000/08/24 18:46:38
(David Hinds)"
;
static
char
*
version
=
"serial_cs.c 1.1
34 2002/05/04 05:48:53
(David Hinds)"
;
#else
#else
#define DEBUG(n, args...)
#define DEBUG(n, args...)
#endif
#endif
...
@@ -74,10 +73,13 @@ static int irq_list[4] = { -1 };
...
@@ -74,10 +73,13 @@ static int irq_list[4] = { -1 };
/* Enable the speaker? */
/* Enable the speaker? */
static
int
do_sound
=
1
;
static
int
do_sound
=
1
;
/* Skip strict UART tests? */
static
int
buggy_uart
;
MODULE_PARM
(
irq_mask
,
"i"
);
MODULE_PARM
(
irq_mask
,
"i"
);
MODULE_PARM
(
irq_list
,
"1-4i"
);
MODULE_PARM
(
irq_list
,
"1-4i"
);
MODULE_PARM
(
do_sound
,
"i"
);
MODULE_PARM
(
do_sound
,
"i"
);
MODULE_PARM
(
buggy_uart
,
"i"
);
/*====================================================================*/
/*====================================================================*/
...
@@ -100,7 +102,7 @@ static struct multi_id multi_id[] = {
...
@@ -100,7 +102,7 @@ static struct multi_id multi_id[] = {
};
};
#define MULTI_COUNT (sizeof(multi_id)/sizeof(struct multi_id))
#define MULTI_COUNT (sizeof(multi_id)/sizeof(struct multi_id))
typedef
struct
serial_info
{
struct
serial_info
{
dev_link_t
link
;
dev_link_t
link
;
int
ndev
;
int
ndev
;
int
multi
;
int
multi
;
...
@@ -108,8 +110,7 @@ typedef struct serial_info {
...
@@ -108,8 +110,7 @@ typedef struct serial_info {
int
manfid
;
int
manfid
;
dev_node_t
node
[
4
];
dev_node_t
node
[
4
];
int
line
[
4
];
int
line
[
4
];
struct
work_struct
remove
;
};
}
serial_info_t
;
static
void
serial_config
(
dev_link_t
*
link
);
static
void
serial_config
(
dev_link_t
*
link
);
static
int
serial_event
(
event_t
event
,
int
priority
,
static
int
serial_event
(
event_t
event
,
int
priority
,
...
@@ -124,20 +125,19 @@ static dev_link_t *dev_list = NULL;
...
@@ -124,20 +125,19 @@ static dev_link_t *dev_list = NULL;
/*======================================================================
/*======================================================================
After a card is removed,
do_serial_releas
e() will unregister
After a card is removed,
serial_remov
e() will unregister
the serial device(s), and release the PCMCIA configuration.
the serial device(s), and release the PCMCIA configuration.
======================================================================*/
======================================================================*/
/*
static
void
serial_remove
(
dev_link_t
*
link
)
* This always runs in process context.
*/
static
void
do_serial_release
(
void
*
arg
)
{
{
struct
serial_info
*
info
=
arg
;
struct
serial_info
*
info
=
link
->
priv
;
int
i
;
int
i
,
ret
;
DEBUG
(
0
,
"serial_release(0x%p)
\n
"
,
&
info
->
link
);
link
->
state
&=
~
DEV_PRESENT
;
DEBUG
(
0
,
"serial_release(0x%p)
\n
"
,
link
);
/*
/*
* Recheck to see if the device is still configured.
* Recheck to see if the device is still configured.
...
@@ -158,25 +158,6 @@ static void do_serial_release(void *arg)
...
@@ -158,25 +158,6 @@ static void do_serial_release(void *arg)
}
}
}
}
/*
* This may be called from IRQ context.
*/
static
void
serial_remove
(
dev_link_t
*
link
)
{
struct
serial_info
*
info
=
link
->
priv
;
link
->
state
&=
~
DEV_PRESENT
;
/*
* FIXME: Since the card has probably been removed,
* we should call into the serial layer and hang up
* the ports on the card immediately.
*/
if
(
link
->
state
&
DEV_CONFIG
)
schedule_work
(
&
info
->
remove
);
}
/*======================================================================
/*======================================================================
serial_attach() creates an "instance" of the driver, allocating
serial_attach() creates an "instance" of the driver, allocating
...
@@ -187,7 +168,7 @@ static void serial_remove(dev_link_t *link)
...
@@ -187,7 +168,7 @@ static void serial_remove(dev_link_t *link)
static
dev_link_t
*
serial_attach
(
void
)
static
dev_link_t
*
serial_attach
(
void
)
{
{
s
erial_info_t
*
info
;
s
truct
serial_info
*
info
;
client_reg_t
client_reg
;
client_reg_t
client_reg
;
dev_link_t
*
link
;
dev_link_t
*
link
;
int
i
,
ret
;
int
i
,
ret
;
...
@@ -202,8 +183,6 @@ static dev_link_t *serial_attach(void)
...
@@ -202,8 +183,6 @@ static dev_link_t *serial_attach(void)
link
=
&
info
->
link
;
link
=
&
info
->
link
;
link
->
priv
=
info
;
link
->
priv
=
info
;
INIT_WORK
(
&
info
->
remove
,
do_serial_release
,
info
);
link
->
io
.
Attributes1
=
IO_DATA_PATH_WIDTH_8
;
link
->
io
.
Attributes1
=
IO_DATA_PATH_WIDTH_8
;
link
->
io
.
NumPorts1
=
8
;
link
->
io
.
NumPorts1
=
8
;
link
->
irq
.
Attributes
=
IRQ_TYPE_EXCLUSIVE
;
link
->
irq
.
Attributes
=
IRQ_TYPE_EXCLUSIVE
;
...
@@ -214,7 +193,6 @@ static dev_link_t *serial_attach(void)
...
@@ -214,7 +193,6 @@ static dev_link_t *serial_attach(void)
for
(
i
=
0
;
i
<
4
;
i
++
)
for
(
i
=
0
;
i
<
4
;
i
++
)
link
->
irq
.
IRQInfo2
|=
1
<<
irq_list
[
i
];
link
->
irq
.
IRQInfo2
|=
1
<<
irq_list
[
i
];
link
->
conf
.
Attributes
=
CONF_ENABLE_IRQ
;
link
->
conf
.
Attributes
=
CONF_ENABLE_IRQ
;
link
->
conf
.
Vcc
=
50
;
if
(
do_sound
)
{
if
(
do_sound
)
{
link
->
conf
.
Attributes
|=
CONF_ENABLE_SPKR
;
link
->
conf
.
Attributes
|=
CONF_ENABLE_SPKR
;
link
->
conf
.
Status
=
CCSR_AUDIO_ENA
;
link
->
conf
.
Status
=
CCSR_AUDIO_ENA
;
...
@@ -254,7 +232,7 @@ static dev_link_t *serial_attach(void)
...
@@ -254,7 +232,7 @@ static dev_link_t *serial_attach(void)
static
void
serial_detach
(
dev_link_t
*
link
)
static
void
serial_detach
(
dev_link_t
*
link
)
{
{
s
erial_info_t
*
info
=
link
->
priv
;
s
truct
serial_info
*
info
=
link
->
priv
;
dev_link_t
**
linkp
;
dev_link_t
**
linkp
;
int
ret
;
int
ret
;
...
@@ -275,7 +253,7 @@ static void serial_detach(dev_link_t * link)
...
@@ -275,7 +253,7 @@ static void serial_detach(dev_link_t * link)
/*
/*
* Ensure that the ports have been released.
* Ensure that the ports have been released.
*/
*/
do_serial_release
(
info
);
serial_remove
(
link
);
if
(
link
->
handle
)
{
if
(
link
->
handle
)
{
ret
=
CardServices
(
DeregisterClient
,
link
->
handle
);
ret
=
CardServices
(
DeregisterClient
,
link
->
handle
);
...
@@ -290,7 +268,7 @@ static void serial_detach(dev_link_t * link)
...
@@ -290,7 +268,7 @@ static void serial_detach(dev_link_t * link)
/*====================================================================*/
/*====================================================================*/
static
int
setup_serial
(
s
erial_info_t
*
info
,
ioaddr_t
port
,
int
irq
)
static
int
setup_serial
(
s
truct
serial_info
*
info
,
ioaddr_t
port
,
int
irq
)
{
{
struct
serial_struct
serial
;
struct
serial_struct
serial
;
int
line
;
int
line
;
...
@@ -299,11 +277,13 @@ static int setup_serial(serial_info_t * info, ioaddr_t port, int irq)
...
@@ -299,11 +277,13 @@ static int setup_serial(serial_info_t * info, ioaddr_t port, int irq)
serial
.
port
=
port
;
serial
.
port
=
port
;
serial
.
irq
=
irq
;
serial
.
irq
=
irq
;
serial
.
flags
=
UPF_SKIP_TEST
|
UPF_SHARE_IRQ
;
serial
.
flags
=
UPF_SKIP_TEST
|
UPF_SHARE_IRQ
;
if
(
buggy_uart
)
serial
.
flags
|=
UPF_BUGGY_UART
;
line
=
register_serial
(
&
serial
);
line
=
register_serial
(
&
serial
);
if
(
line
<
0
)
{
if
(
line
<
0
)
{
printk
(
KERN_NOTICE
"serial_cs: register_serial() at 0x%04lx,"
printk
(
KERN_NOTICE
"serial_cs: register_serial() at 0x%04lx,"
" irq %d failed
\n
"
,
(
u_long
)
serial
.
port
,
serial
.
irq
);
" irq %d failed
\n
"
,
(
u_long
)
serial
.
port
,
serial
.
irq
);
return
-
1
;
return
-
EINVAL
;
}
}
info
->
line
[
info
->
ndev
]
=
line
;
info
->
line
[
info
->
ndev
]
=
line
;
...
@@ -341,7 +321,7 @@ static int simple_config(dev_link_t * link)
...
@@ -341,7 +321,7 @@ static int simple_config(dev_link_t * link)
{
{
static
ioaddr_t
base
[
5
]
=
{
0x3f8
,
0x2f8
,
0x3e8
,
0x2e8
,
0x0
};
static
ioaddr_t
base
[
5
]
=
{
0x3f8
,
0x2f8
,
0x3e8
,
0x2e8
,
0x0
};
client_handle_t
handle
=
link
->
handle
;
client_handle_t
handle
=
link
->
handle
;
s
erial_info_t
*
info
=
link
->
priv
;
s
truct
serial_info
*
info
=
link
->
priv
;
tuple_t
tuple
;
tuple_t
tuple
;
u_char
buf
[
256
];
u_char
buf
[
256
];
cisparse_t
parse
;
cisparse_t
parse
;
...
@@ -445,13 +425,21 @@ static int simple_config(dev_link_t * link)
...
@@ -445,13 +425,21 @@ static int simple_config(dev_link_t * link)
static
int
multi_config
(
dev_link_t
*
link
)
static
int
multi_config
(
dev_link_t
*
link
)
{
{
client_handle_t
handle
=
link
->
handle
;
client_handle_t
handle
=
link
->
handle
;
s
erial_info_t
*
info
=
link
->
priv
;
s
truct
serial_info
*
info
=
link
->
priv
;
tuple_t
tuple
;
tuple_t
tuple
;
u_char
buf
[
256
];
u_char
buf
[
256
];
cisparse_t
parse
;
cisparse_t
parse
;
cistpl_cftable_entry_t
*
cf
=
&
parse
.
cftable_entry
;
cistpl_cftable_entry_t
*
cf
=
&
parse
.
cftable_entry
;
config_info_t
config
;
int
i
,
base2
=
0
;
int
i
,
base2
=
0
;
i
=
CardServices
(
GetConfigurationInfo
,
handle
,
&
config
);
if
(
i
!=
CS_SUCCESS
)
{
cs_error
(
handle
,
GetConfiguration
,
i
);
return
-
1
;
}
link
->
conf
.
Vcc
=
config
.
Vcc
;
tuple
.
TupleData
=
(
cisdata_t
*
)
buf
;
tuple
.
TupleData
=
(
cisdata_t
*
)
buf
;
tuple
.
TupleOffset
=
0
;
tuple
.
TupleOffset
=
0
;
tuple
.
TupleDataMax
=
255
;
tuple
.
TupleDataMax
=
255
;
...
@@ -524,6 +512,19 @@ static int multi_config(dev_link_t * link)
...
@@ -524,6 +512,19 @@ static int multi_config(dev_link_t * link)
return
-
1
;
return
-
1
;
}
}
/* The Oxford Semiconductor OXCF950 cards are in fact single-port:
8 registers are for the UART, the others are extra registers */
if
(
info
->
manfid
==
MANFID_OXSEMI
)
{
if
(
cf
->
index
==
1
||
cf
->
index
==
3
)
{
setup_serial
(
info
,
base2
,
link
->
irq
.
AssignedIRQ
);
outb
(
12
,
link
->
io
.
BasePort1
+
1
);
}
else
{
setup_serial
(
info
,
link
->
io
.
BasePort1
,
link
->
irq
.
AssignedIRQ
);
outb
(
12
,
base2
+
1
);
}
return
0
;
}
setup_serial
(
info
,
link
->
io
.
BasePort1
,
link
->
irq
.
AssignedIRQ
);
setup_serial
(
info
,
link
->
io
.
BasePort1
,
link
->
irq
.
AssignedIRQ
);
/* The Nokia cards are not really multiport cards */
/* The Nokia cards are not really multiport cards */
if
(
info
->
manfid
==
MANFID_NOKIA
)
if
(
info
->
manfid
==
MANFID_NOKIA
)
...
@@ -548,7 +549,7 @@ while ((last_ret=CardServices(last_fn=(fn), args))!=0) goto cs_failed
...
@@ -548,7 +549,7 @@ while ((last_ret=CardServices(last_fn=(fn), args))!=0) goto cs_failed
void
serial_config
(
dev_link_t
*
link
)
void
serial_config
(
dev_link_t
*
link
)
{
{
client_handle_t
handle
=
link
->
handle
;
client_handle_t
handle
=
link
->
handle
;
s
erial_info_t
*
info
=
link
->
priv
;
s
truct
serial_info
*
info
=
link
->
priv
;
tuple_t
tuple
;
tuple_t
tuple
;
u_short
buf
[
128
];
u_short
buf
[
128
];
cisparse_t
parse
;
cisparse_t
parse
;
...
@@ -631,7 +632,8 @@ void serial_config(dev_link_t * link)
...
@@ -631,7 +632,8 @@ void serial_config(dev_link_t * link)
cs_failed:
cs_failed:
cs_error
(
link
->
handle
,
last_fn
,
last_ret
);
cs_error
(
link
->
handle
,
last_fn
,
last_ret
);
failed:
failed:
do_serial_release
(
info
);
serial_remove
(
link
);
link
->
state
&=
~
DEV_CONFIG_PENDING
;
}
}
/*======================================================================
/*======================================================================
...
@@ -647,7 +649,7 @@ static int
...
@@ -647,7 +649,7 @@ static int
serial_event
(
event_t
event
,
int
priority
,
event_callback_args_t
*
args
)
serial_event
(
event_t
event
,
int
priority
,
event_callback_args_t
*
args
)
{
{
dev_link_t
*
link
=
args
->
client_data
;
dev_link_t
*
link
=
args
->
client_data
;
s
erial_info_t
*
info
=
link
->
priv
;
s
truct
serial_info
*
info
=
link
->
priv
;
DEBUG
(
1
,
"serial_event(0x%06x)
\n
"
,
event
);
DEBUG
(
1
,
"serial_event(0x%06x)
\n
"
,
event
);
...
...
drivers/serial/Kconfig
View file @
ed06d524
...
@@ -80,14 +80,14 @@ config SERIAL_8250_CS
...
@@ -80,14 +80,14 @@ config SERIAL_8250_CS
config SERIAL_8250_ACPI
config SERIAL_8250_ACPI
bool "8250/16550 device discovery via ACPI namespace"
bool "8250/16550 device discovery via ACPI namespace"
default y if IA64
default y if IA64
depends on ACPI_BUS
depends on ACPI_BUS
&& SERIAL_8250
---help---
---help---
If you wish to enable serial port discovery via the ACPI
If you wish to enable serial port discovery via the ACPI
namespace, say Y here. If unsure, say N.
namespace, say Y here. If unsure, say N.
config SERIAL_8250_HCDP
config SERIAL_8250_HCDP
bool "8250/16550 device discovery support via EFI HCDP table"
bool "8250/16550 device discovery support via EFI HCDP table"
depends on IA64
depends on IA64
&& SERIAL_8250
---help---
---help---
If you wish to make the serial console port described by the EFI
If you wish to make the serial console port described by the EFI
HCDP table available for use as serial console or general
HCDP table available for use as serial console or general
...
...
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