Skip to content

Commit

Permalink
net/irda/sh_irda: return to RX mode when TX error
Browse files Browse the repository at this point in the history
sh_irda can not use RX/TX in same time,
but this driver didn't return to RX mode when TX error occurred.
This patch care xmit error case to solve this issue.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Kuninori Morimoto authored and David S. Miller committed Jan 19, 2011
1 parent 6ee400a commit 5ae2f66
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions drivers/net/irda/sh_irda.c
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ static int sh_irda_hard_xmit(struct sk_buff *skb, struct net_device *ndev)

ret = sh_irda_set_baudrate(self, speed);
if (ret < 0)
return ret;
goto sh_irda_hard_xmit_end;

self->tx_buff.len = 0;
if (skb->len) {
Expand All @@ -652,11 +652,21 @@ static int sh_irda_hard_xmit(struct sk_buff *skb, struct net_device *ndev)

sh_irda_write(self, IRTFLR, self->tx_buff.len);
sh_irda_write(self, IRTCTR, ARMOD | TE);
}
} else
goto sh_irda_hard_xmit_end;

dev_kfree_skb(skb);

return 0;

sh_irda_hard_xmit_end:
sh_irda_set_baudrate(self, 9600);
netif_wake_queue(self->ndev);
sh_irda_rcv_ctrl(self, 1);
dev_kfree_skb(skb);

return ret;

}

static int sh_irda_ioctl(struct net_device *ndev, struct ifreq *ifreq, int cmd)
Expand Down

0 comments on commit 5ae2f66

Please sign in to comment.