Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 368718
b: refs/heads/master
c: 1486774
h: refs/heads/master
v: v3
  • Loading branch information
stefan@datenfreihafen.org authored and David S. Miller committed Mar 27, 2013
1 parent 497024c commit 4c97415
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6364e6ee788ae60f1c2de5c59e39adb157327e6c
refs/heads/master: 1486774d69f6e58da16cdae8f17c77ec6569f711
47 changes: 47 additions & 0 deletions trunk/drivers/net/ieee802154/at86rf230.c
Original file line number Diff line number Diff line change
Expand Up @@ -619,13 +619,60 @@ static int at86rf230_rx(struct at86rf230_local *lp)
return -EINVAL;
}

static int
at86rf230_set_hw_addr_filt(struct ieee802154_dev *dev,
struct ieee802154_hw_addr_filt *filt,
unsigned long changed)
{
struct at86rf230_local *lp = dev->priv;

if (changed & IEEE802515_AFILT_SADDR_CHANGED) {
dev_vdbg(&lp->spi->dev,
"at86rf230_set_hw_addr_filt called for saddr\n");
__at86rf230_write(lp, RG_SHORT_ADDR_0, filt->short_addr);
__at86rf230_write(lp, RG_SHORT_ADDR_1, filt->short_addr >> 8);
}

if (changed & IEEE802515_AFILT_PANID_CHANGED) {
dev_vdbg(&lp->spi->dev,
"at86rf230_set_hw_addr_filt called for pan id\n");
__at86rf230_write(lp, RG_PAN_ID_0, filt->pan_id);
__at86rf230_write(lp, RG_PAN_ID_1, filt->pan_id >> 8);
}

if (changed & IEEE802515_AFILT_IEEEADDR_CHANGED) {
dev_vdbg(&lp->spi->dev,
"at86rf230_set_hw_addr_filt called for IEEE addr\n");
at86rf230_write_subreg(lp, SR_IEEE_ADDR_0, filt->ieee_addr[7]);
at86rf230_write_subreg(lp, SR_IEEE_ADDR_1, filt->ieee_addr[6]);
at86rf230_write_subreg(lp, SR_IEEE_ADDR_2, filt->ieee_addr[5]);
at86rf230_write_subreg(lp, SR_IEEE_ADDR_3, filt->ieee_addr[4]);
at86rf230_write_subreg(lp, SR_IEEE_ADDR_4, filt->ieee_addr[3]);
at86rf230_write_subreg(lp, SR_IEEE_ADDR_5, filt->ieee_addr[2]);
at86rf230_write_subreg(lp, SR_IEEE_ADDR_6, filt->ieee_addr[1]);
at86rf230_write_subreg(lp, SR_IEEE_ADDR_7, filt->ieee_addr[0]);
}

if (changed & IEEE802515_AFILT_PANC_CHANGED) {
dev_vdbg(&lp->spi->dev,
"at86rf230_set_hw_addr_filt called for panc change\n");
if (filt->pan_coord)
at86rf230_write_subreg(lp, SR_AACK_I_AM_COORD, 1);
else
at86rf230_write_subreg(lp, SR_AACK_I_AM_COORD, 0);
}

return 0;
}

static struct ieee802154_ops at86rf230_ops = {
.owner = THIS_MODULE,
.xmit = at86rf230_xmit,
.ed = at86rf230_ed,
.set_channel = at86rf230_channel,
.start = at86rf230_start,
.stop = at86rf230_stop,
.set_hw_addr_filt = at86rf230_set_hw_addr_filt,
};

static void at86rf230_irqwork(struct work_struct *work)
Expand Down

0 comments on commit 4c97415

Please sign in to comment.