On 03/20/2015 09:00 PM, Alexander Aring wrote:
Hi,
On Fri, Mar 20, 2015 at 12:52:19PM +0530, Varka Bhadram wrote:
Signed-off-by: Varka Bhadram <varkab@xxxxxxx>
---
drivers/net/ieee802154/cc2520.c | 56 ++++++++++++++++++++++++++++++++++++++-
1 file changed, 55 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ieee802154/cc2520.c b/drivers/net/ieee802154/cc2520.c
index f833b8b..f96cc50 100644
--- a/drivers/net/ieee802154/cc2520.c
+++ b/drivers/net/ieee802154/cc2520.c
@@ -53,6 +53,17 @@
#define CC2520_MAXCHANNEL 26
#define CC2520_CHANNEL_SPACING 5
+/* Tx power values */
+#define CC2520_TXPOWER_0 0x03 /* -18dbm */
+#define CC2520_TXPOWER_1 0x2c /* -7dbm */
+#define CC2520_TXPOWER_2 0x88 /* -4dbm */
+#define CC2520_TXPOWER_3 0x81 /* -2dbm */
+#define CC2520_TXPOWER_4 0x32 /* 0dbm */
+#define CC2520_TXPOWER_5 0x13 /* 1dbm */
+#define CC2520_TXPOWER_6 0xab /* 2dbm */
+#define CC2520_TXPOWER_7 0xf2 /* 3dbm */
+#define CC2520_TXPOWER_8 0xf7 /* 5dbm */
+
/* command strobes */
#define CC2520_CMD_SNOP 0x00
#define CC2520_CMD_IBUFLD 0x02
@@ -628,6 +639,48 @@ cc2520_filter(struct ieee802154_hw *hw,
return 0;
}
+static int
+cc2520_set_txpower(struct ieee802154_hw *hw, int db)
+{
our netlink attribute is s8, maybe we should fix the mac layer at first
and change the int to s8.
Ok. I will look into that.
- Alex
--
Varka Bhadram
--
To unsubscribe from this list: send the line "unsubscribe linux-wpan" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html