diff options
Diffstat (limited to 'drivers/net/ieee802154/mrf24j40.c')
-rw-r--r-- | drivers/net/ieee802154/mrf24j40.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/net/ieee802154/mrf24j40.c b/drivers/net/ieee802154/mrf24j40.c index 246befa4ba05..78a6552ed707 100644 --- a/drivers/net/ieee802154/mrf24j40.c +++ b/drivers/net/ieee802154/mrf24j40.c | |||
@@ -465,8 +465,8 @@ static int mrf24j40_filter(struct ieee802154_dev *dev, | |||
465 | if (changed & IEEE802515_AFILT_SADDR_CHANGED) { | 465 | if (changed & IEEE802515_AFILT_SADDR_CHANGED) { |
466 | /* Short Addr */ | 466 | /* Short Addr */ |
467 | u8 addrh, addrl; | 467 | u8 addrh, addrl; |
468 | addrh = filt->short_addr >> 8 & 0xff; | 468 | addrh = le16_to_cpu(filt->short_addr) >> 8 & 0xff; |
469 | addrl = filt->short_addr & 0xff; | 469 | addrl = le16_to_cpu(filt->short_addr) & 0xff; |
470 | 470 | ||
471 | write_short_reg(devrec, REG_SADRH, addrh); | 471 | write_short_reg(devrec, REG_SADRH, addrh); |
472 | write_short_reg(devrec, REG_SADRL, addrl); | 472 | write_short_reg(devrec, REG_SADRL, addrl); |
@@ -476,15 +476,16 @@ static int mrf24j40_filter(struct ieee802154_dev *dev, | |||
476 | 476 | ||
477 | if (changed & IEEE802515_AFILT_IEEEADDR_CHANGED) { | 477 | if (changed & IEEE802515_AFILT_IEEEADDR_CHANGED) { |
478 | /* Device Address */ | 478 | /* Device Address */ |
479 | int i; | 479 | u8 i, addr[8]; |
480 | |||
481 | memcpy(addr, &filt->ieee_addr, 8); | ||
480 | for (i = 0; i < 8; i++) | 482 | for (i = 0; i < 8; i++) |
481 | write_short_reg(devrec, REG_EADR0+i, | 483 | write_short_reg(devrec, REG_EADR0 + i, addr[i]); |
482 | filt->ieee_addr[7-i]); | ||
483 | 484 | ||
484 | #ifdef DEBUG | 485 | #ifdef DEBUG |
485 | printk(KERN_DEBUG "Set long addr to: "); | 486 | printk(KERN_DEBUG "Set long addr to: "); |
486 | for (i = 0; i < 8; i++) | 487 | for (i = 0; i < 8; i++) |
487 | printk("%02hhx ", filt->ieee_addr[i]); | 488 | printk("%02hhx ", addr[7 - i]); |
488 | printk(KERN_DEBUG "\n"); | 489 | printk(KERN_DEBUG "\n"); |
489 | #endif | 490 | #endif |
490 | } | 491 | } |
@@ -492,8 +493,8 @@ static int mrf24j40_filter(struct ieee802154_dev *dev, | |||
492 | if (changed & IEEE802515_AFILT_PANID_CHANGED) { | 493 | if (changed & IEEE802515_AFILT_PANID_CHANGED) { |
493 | /* PAN ID */ | 494 | /* PAN ID */ |
494 | u8 panidl, panidh; | 495 | u8 panidl, panidh; |
495 | panidh = filt->pan_id >> 8 & 0xff; | 496 | panidh = le16_to_cpu(filt->pan_id) >> 8 & 0xff; |
496 | panidl = filt->pan_id & 0xff; | 497 | panidl = le16_to_cpu(filt->pan_id) & 0xff; |
497 | write_short_reg(devrec, REG_PANIDH, panidh); | 498 | write_short_reg(devrec, REG_PANIDH, panidh); |
498 | write_short_reg(devrec, REG_PANIDL, panidl); | 499 | write_short_reg(devrec, REG_PANIDL, panidl); |
499 | 500 | ||