Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 171256
b: refs/heads/master
c: a0b4a73
h: refs/heads/master
v: v3
  • Loading branch information
Dmitry Eremin-Solenikov committed Nov 6, 2009
1 parent 47d4619 commit 70acfe7
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 375bb0e04b618d0c425b0ea492d16cf71eb94905
refs/heads/master: a0b4a738e0e03f5e0d6ca366560f9a48e5adf83a
2 changes: 1 addition & 1 deletion trunk/drivers/ieee802154/fakehard.c
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ static int __devinit ieee802154fake_probe(struct platform_device *pdev)
dev->addr_len);
memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len);

phy->channels_supported = (1 << 27) - 1;
phy->channels_supported[0] = (1 << 27) - 1;
phy->transmit_power = 0xbf;

dev->netdev_ops = &fake_ops;
Expand Down
2 changes: 1 addition & 1 deletion trunk/include/net/wpan-phy.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ struct wpan_phy {
*/
u8 current_channel;
u8 current_page;
u32 channels_supported;
u32 channels_supported[32];
u8 transmit_power;
u8 cca_mode;

Expand Down
20 changes: 19 additions & 1 deletion trunk/net/ieee802154/wpan-class.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,30 @@ static ssize_t name ## _show(struct device *dev, \

MASTER_SHOW(current_channel, "%d");
MASTER_SHOW(current_page, "%d");
MASTER_SHOW(channels_supported, "%#x");
MASTER_SHOW_COMPLEX(transmit_power, "%d +- %d dB",
((signed char) (phy->transmit_power << 2)) >> 2,
(phy->transmit_power >> 6) ? (phy->transmit_power >> 6) * 3 : 1 );
MASTER_SHOW(cca_mode, "%d");

static ssize_t channels_supported_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct wpan_phy *phy = container_of(dev, struct wpan_phy, dev);
int ret;
int i, len = 0;

mutex_lock(&phy->pib_lock);
for (i = 0; i < 32; i++) {
ret = snprintf(buf + len, PAGE_SIZE - len,
"%#09x\n", phy->channels_supported[i]);
if (ret < 0)
break;
len += ret;
}
mutex_unlock(&phy->pib_lock);
return len;
}

static struct device_attribute pmib_attrs[] = {
__ATTR_RO(current_channel),
__ATTR_RO(current_page),
Expand Down

0 comments on commit 70acfe7

Please sign in to comment.