Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
89c2a4c5
Commit
89c2a4c5
authored
Oct 13, 2011
by
Uwe Bonnes
Committed by
Alexandre Julliard
Oct 14, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Generate a single EV_TXEMPTY when the TX buffer turns empty.
parent
876d5519
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
21 deletions
+33
-21
serial.c
dlls/ntdll/serial.c
+33
-21
No files found.
dlls/ntdll/serial.c
View file @
89c2a4c5
...
...
@@ -785,6 +785,7 @@ static NTSTATUS set_XOn(int fd)
typedef
struct
serial_irq_info
{
int
rx
,
tx
,
frame
,
overrun
,
parity
,
brk
,
buf_overrun
;
DWORD
temt
;
}
serial_irq_info
;
/***********************************************************************
...
...
@@ -806,7 +807,6 @@ typedef struct async_commio
*/
static
NTSTATUS
get_irq_info
(
int
fd
,
serial_irq_info
*
irq_info
)
{
NTSTATUS
status
=
STATUS_NOT_IMPLEMENTED
;
#ifdef TIOCGICOUNT
struct
serial_icounter_struct
einfo
;
if
(
!
ioctl
(
fd
,
TIOCGICOUNT
,
&
einfo
))
...
...
@@ -818,13 +818,38 @@ static NTSTATUS get_irq_info(int fd, serial_irq_info *irq_info)
irq_info
->
parity
=
einfo
.
parity
;
irq_info
->
brk
=
einfo
.
brk
;
irq_info
->
buf_overrun
=
einfo
.
buf_overrun
;
return
STATUS_SUCCESS
;
}
TRACE
(
"TIOCGICOUNT err %s
\n
"
,
strerror
(
errno
));
status
=
FILE_GetNtStatus
();
#endif
else
{
TRACE
(
"TIOCGICOUNT err %s
\n
"
,
strerror
(
errno
));
memset
(
irq_info
,
0
,
sizeof
(
serial_irq_info
));
return
FILE_GetNtStatus
();
}
#else
memset
(
irq_info
,
0
,
sizeof
(
serial_irq_info
));
return
status
;
return
STATUS_NOT_IMPLEMENTED
;
#endif
irq_info
->
temt
=
0
;
/* Generate a single TX_TXEMPTY event when the TX Buffer turns empty*/
#ifdef TIOCSERGETLSR
/* prefer to log the state TIOCSERGETLSR */
if
(
ioctl
(
fd
,
TIOCSERGETLSR
,
&
irq_info
->
temt
))
{
TRACE
(
"TIOCSERGETLSR err %s
\n
"
,
strerror
(
errno
));
return
FILE_GetNtStatus
();
}
#elif defined(TIOCOUTQ)
/* otherwise we log when the out queue gets empty */
if
(
ioctl
(
fd
,
TIOCOUTQ
,
&
irq_info
->
temt
))
{
TRACE
(
"TIOCOUTQ err %s
\n
"
,
strerror
(
errno
));
return
FILE_GetNtStatus
();
}
else
{
if
(
irq_info
->
temt
==
0
)
irq_info
->
temt
=
1
;
}
#endif
return
STATUS_SUCCESS
;
}
...
...
@@ -862,21 +887,8 @@ static DWORD check_events(int fd, DWORD mask,
}
if
(
mask
&
EV_TXEMPTY
)
{
queue
=
0
;
/* We really want to know when all characters have gone out of the transmitter */
#if defined(TIOCSERGETLSR)
if
(
ioctl
(
fd
,
TIOCSERGETLSR
,
&
queue
))
WARN
(
"TIOCSERGETLSR returned error
\n
"
);
if
(
queue
)
/* TIOCOUTQ only checks for an empty buffer */
#elif defined(TIOCOUTQ)
if
(
ioctl
(
fd
,
TIOCOUTQ
,
&
queue
))
WARN
(
"TIOCOUTQ returned error
\n
"
);
if
(
!
queue
)
#endif
ret
|=
EV_TXEMPTY
;
TRACE
(
"OUTQUEUE %d, Transmitter %sempty
\n
"
,
queue
,
(
ret
&
EV_TXEMPTY
)
?
""
:
"not "
);
if
(
!
old
->
temt
&&
new
->
temt
)
ret
|=
EV_TXEMPTY
;
}
return
ret
&
mask
;
}
...
...
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