aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
Diffstat (limited to 'hw')
-rw-r--r--hw/bt/hci-csr.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/hw/bt/hci-csr.c b/hw/bt/hci-csr.c
index b77c036..cdf52a9 100644
--- a/hw/bt/hci-csr.c
+++ b/hw/bt/hci-csr.c
@@ -78,15 +78,17 @@ enum {
static inline void csrhci_fifo_wake(struct csrhci_s *s)
{
+ CharBackend *be = s->chr.be;
+
if (!s->enable || !s->out_len)
return;
/* XXX: Should wait for s->modem_state & CHR_TIOCM_RTS? */
- if (s->chr.chr_can_read && s->chr.chr_can_read(s->chr.handler_opaque) &&
- s->chr.chr_read) {
- s->chr.chr_read(s->chr.handler_opaque,
- s->outfifo + s->out_start ++, 1);
- s->out_len --;
+ if (be && be->chr_can_read && be->chr_can_read(be->opaque) &&
+ be->chr_read) {
+ be->chr_read(be->opaque,
+ s->outfifo + s->out_start++, 1);
+ s->out_len--;
if (s->out_start >= s->out_size) {
s->out_start = 0;
s->out_size = FIFO_LEN;