Skip to content

Commit

Permalink
ucc/hdlc: fix two little issue
Browse files Browse the repository at this point in the history
1. modify bd_status from u32 to u16 in function hdlc_rx_done,
because bd_status register is 16bits
2. write bd_length register before writing bd_status register

Signed-off-by: Zhao Qiang <qiang.zhao@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
ZhaoQiang-b45475 authored and davem330 committed Mar 14, 2017
1 parent c80498e commit 02bb56d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/wan/fsl_ucc_hdlc.c
Original file line number Diff line number Diff line change
Expand Up @@ -381,8 +381,8 @@ static netdev_tx_t ucc_hdlc_tx(struct sk_buff *skb, struct net_device *dev)
/* set bd status and length */
bd_status = (bd_status & T_W_S) | T_R_S | T_I_S | T_L_S | T_TC_S;

iowrite16be(bd_status, &bd->status);
iowrite16be(skb->len, &bd->length);
iowrite16be(bd_status, &bd->status);

/* Move to next BD in the ring */
if (!(bd_status & T_W_S))
Expand Down Expand Up @@ -457,7 +457,7 @@ static int hdlc_rx_done(struct ucc_hdlc_private *priv, int rx_work_limit)
struct sk_buff *skb;
hdlc_device *hdlc = dev_to_hdlc(dev);
struct qe_bd *bd;
u32 bd_status;
u16 bd_status;
u16 length, howmany = 0;
u8 *bdbuffer;
int i;
Expand Down

0 comments on commit 02bb56d

Please sign in to comment.