Commit 045f77ba authored by David Gounaris's avatar David Gounaris Committed by David S. Miller

net/wan/fsl_ucc_hdlc: hmask

Ability to set hmask in the device-tree,
which can be used to change address
filtering of packets.
Signed-off-by: default avatarDavid Gounaris <david.gounaris@infinera.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8978ca7c
...@@ -98,6 +98,12 @@ The property below is dependent on fsl,tdm-interface: ...@@ -98,6 +98,12 @@ The property below is dependent on fsl,tdm-interface:
usage: optional for tdm interface usage: optional for tdm interface
value type: <empty> value type: <empty>
Definition : Internal loopback connecting on TDM layer. Definition : Internal loopback connecting on TDM layer.
- fsl,hmask
usage: optional
Value type: <u16>
Definition: HDLC address recognition. Set to zero to disable
address filtering of packets:
fsl,hmask = /bits/ 16 <0x0000>;
Example for tdm interface: Example for tdm interface:
......
...@@ -265,7 +265,7 @@ static int uhdlc_init(struct ucc_hdlc_private *priv) ...@@ -265,7 +265,7 @@ static int uhdlc_init(struct ucc_hdlc_private *priv)
iowrite16be(MAX_FRAME_LENGTH, &priv->ucc_pram->mflr); iowrite16be(MAX_FRAME_LENGTH, &priv->ucc_pram->mflr);
iowrite16be(DEFAULT_RFTHR, &priv->ucc_pram->rfthr); iowrite16be(DEFAULT_RFTHR, &priv->ucc_pram->rfthr);
iowrite16be(DEFAULT_RFTHR, &priv->ucc_pram->rfcnt); iowrite16be(DEFAULT_RFTHR, &priv->ucc_pram->rfcnt);
iowrite16be(DEFAULT_ADDR_MASK, &priv->ucc_pram->hmask); iowrite16be(priv->hmask, &priv->ucc_pram->hmask);
iowrite16be(DEFAULT_HDLC_ADDR, &priv->ucc_pram->haddr1); iowrite16be(DEFAULT_HDLC_ADDR, &priv->ucc_pram->haddr1);
iowrite16be(DEFAULT_HDLC_ADDR, &priv->ucc_pram->haddr2); iowrite16be(DEFAULT_HDLC_ADDR, &priv->ucc_pram->haddr2);
iowrite16be(DEFAULT_HDLC_ADDR, &priv->ucc_pram->haddr3); iowrite16be(DEFAULT_HDLC_ADDR, &priv->ucc_pram->haddr3);
...@@ -1096,6 +1096,9 @@ static int ucc_hdlc_probe(struct platform_device *pdev) ...@@ -1096,6 +1096,9 @@ static int ucc_hdlc_probe(struct platform_device *pdev)
goto free_utdm; goto free_utdm;
} }
if (of_property_read_u16(np, "fsl,hmask", &uhdlc_priv->hmask))
uhdlc_priv->hmask = DEFAULT_ADDR_MASK;
ret = uhdlc_init(uhdlc_priv); ret = uhdlc_init(uhdlc_priv);
if (ret) { if (ret) {
dev_err(&pdev->dev, "Failed to init uhdlc\n"); dev_err(&pdev->dev, "Failed to init uhdlc\n");
......
...@@ -106,6 +106,7 @@ struct ucc_hdlc_private { ...@@ -106,6 +106,7 @@ struct ucc_hdlc_private {
unsigned short encoding; unsigned short encoding;
unsigned short parity; unsigned short parity;
unsigned short hmask;
u32 clocking; u32 clocking;
spinlock_t lock; /* lock for Tx BD and Tx buffer */ spinlock_t lock; /* lock for Tx BD and Tx buffer */
#ifdef CONFIG_PM #ifdef CONFIG_PM
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment