* [PATCHv2 bluetooth-next 0/4] Atusb driver improvements
@ 2015-05-29 8:51 Stefan Schmidt
2015-05-29 8:51 ` [PATCHv2 bluetooth-next 1/4] ieee802154/atusb: Add function for partial register writes Stefan Schmidt
` (6 more replies)
0 siblings, 7 replies; 11+ messages in thread
From: Stefan Schmidt @ 2015-05-29 8:51 UTC (permalink / raw)
To: linux-wpan; +Cc: Alexander Aring, Stefan Schmidt
Hello.
Some patches to let the atusb driver catchup a bit with newer stack features.
Namely we now support tx power and promiscuous mode setting. The first patch
adds some infrastructure for this by adding a function to write parts of a
register.
The last patch adds me as the maintainer for the driver. Alex suggested that
I should do this and as I have the device, working on the firmware as well
and are motivated to enhance it I think its a good idea.
Changes in v2:
Fix checkpatch complains pointed out by Varka Bhadram
Stefan Schmidt (4):
ieee802154/atusb: Add function for partial register writes
ieee802154/atusb: Add .set_txpower operation to the driver
ieee802154/atusb: Add .set_promiscuous_mode driver operation
MAINTAINERS: Add myself as maintainer for the atusb driver
MAINTAINERS | 8 ++++
drivers/net/ieee802154/atusb.c | 101 +++++++++++++++++++++++++++++++++--------
2 files changed, 90 insertions(+), 19 deletions(-)
regards
Stefan Schmidt
--
2.1.0
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCHv2 bluetooth-next 1/4] ieee802154/atusb: Add function for partial register writes
2015-05-29 8:51 [PATCHv2 bluetooth-next 0/4] Atusb driver improvements Stefan Schmidt
@ 2015-05-29 8:51 ` Stefan Schmidt
2015-05-29 8:51 ` [PATCHv2 bluetooth-next 2/4] ieee802154/atusb: Add .set_txpower operation to the driver Stefan Schmidt
` (5 subsequent siblings)
6 siblings, 0 replies; 11+ messages in thread
From: Stefan Schmidt @ 2015-05-29 8:51 UTC (permalink / raw)
To: linux-wpan; +Cc: Alexander Aring, Stefan Schmidt, Stefan Schmidt
From: Stefan Schmidt <s.schmidt@samsung.com>
With this function we can set individual bits in the registers if needed.
With the old SR_VALUE macro we could only set one bit in the register
which was ok for some scenarios but not for all. With this subreg write
function we can now set more bits defined by the mask while not touching
the rest.
We start using it for the current SR_VALUE use case and will use it more
in upcoming patches.
Signed-off-by: Stefan Schmidt <stefan@osg.samsung.com>
---
drivers/net/ieee802154/atusb.c | 45 +++++++++++++++++++++++++-----------------
1 file changed, 27 insertions(+), 18 deletions(-)
diff --git a/drivers/net/ieee802154/atusb.c b/drivers/net/ieee802154/atusb.c
index 5b6bb9a..95d4220 100644
--- a/drivers/net/ieee802154/atusb.c
+++ b/drivers/net/ieee802154/atusb.c
@@ -58,17 +58,6 @@ struct atusb {
uint8_t tx_ack_seq; /* current TX ACK sequence number */
};
-/* at86rf230.h defines values as <reg, mask, shift> tuples. We use the more
- * traditional style of having registers and or-able values. SR_REG extracts
- * the register number. SR_VALUE uses the shift to prepare a value accordingly.
- */
-
-#define __SR_REG(reg, mask, shift) (reg)
-#define SR_REG(sr) __SR_REG(sr)
-
-#define __SR_VALUE(reg, mask, shift, val) ((val) << (shift))
-#define SR_VALUE(sr, val) __SR_VALUE(sr, (val))
-
/* ----- USB commands without data ----------------------------------------- */
/* To reduce the number of error checks in the code, we record the first error
@@ -130,6 +119,30 @@ static int atusb_read_reg(struct atusb *atusb, uint8_t reg)
return ret >= 0 ? value : ret;
}
+static int atusb_write_subreg(struct atusb *atusb, uint8_t reg, uint8_t mask,
+ uint8_t shift, uint8_t value)
+{
+ struct usb_device *usb_dev = atusb->usb_dev;
+ uint8_t orig, tmp;
+ int ret = 0;
+
+ dev_dbg(&usb_dev->dev, "atusb_write_subreg: 0x%02x <- 0x%02x\n",
+ reg, value);
+
+ orig = atusb_read_reg(atusb, reg);
+
+ /* Write the value only into that part of the register which is allowed
+ * by the mask. All other bits stay as before.
+ */
+ tmp = orig & ~mask;
+ tmp |= (value << shift) & mask;
+
+ if (tmp != orig)
+ ret = atusb_write_reg(atusb, reg, tmp);
+
+ return ret;
+}
+
static int atusb_get_and_clear_error(struct atusb *atusb)
{
int err = atusb->err;
@@ -376,7 +389,6 @@ static int atusb_set_hw_addr_filt(struct ieee802154_hw *hw,
{
struct atusb *atusb = hw->priv;
struct device *dev = &atusb->usb_dev->dev;
- uint8_t reg;
if (changed & IEEE802154_AFILT_SADDR_CHANGED) {
u16 addr = le16_to_cpu(filt->short_addr);
@@ -406,12 +418,10 @@ static int atusb_set_hw_addr_filt(struct ieee802154_hw *hw,
if (changed & IEEE802154_AFILT_PANC_CHANGED) {
dev_vdbg(dev,
"atusb_set_hw_addr_filt called for panc change\n");
- reg = atusb_read_reg(atusb, SR_REG(SR_AACK_I_AM_COORD));
if (filt->pan_coord)
- reg |= SR_VALUE(SR_AACK_I_AM_COORD, 1);
+ atusb_write_subreg(atusb, SR_AACK_I_AM_COORD, 1);
else
- reg &= ~SR_VALUE(SR_AACK_I_AM_COORD, 1);
- atusb_write_reg(atusb, SR_REG(SR_AACK_I_AM_COORD), reg);
+ atusb_write_subreg(atusb, SR_AACK_I_AM_COORD, 0);
}
return atusb_get_and_clear_error(atusb);
@@ -622,8 +632,7 @@ static int atusb_probe(struct usb_interface *interface,
* http://www.jennic.com/download_file.php?supportFile=JN-AN-1035%20Calculating%20802-15-4%20Data%20Rates-1v0.pdf
*/
- atusb_write_reg(atusb,
- SR_REG(SR_RX_SAFE_MODE), SR_VALUE(SR_RX_SAFE_MODE, 1));
+ atusb_write_subreg(atusb, SR_RX_SAFE_MODE, 1);
#endif
atusb_write_reg(atusb, RG_IRQ_MASK, 0xff);
--
2.1.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCHv2 bluetooth-next 2/4] ieee802154/atusb: Add .set_txpower operation to the driver
2015-05-29 8:51 [PATCHv2 bluetooth-next 0/4] Atusb driver improvements Stefan Schmidt
2015-05-29 8:51 ` [PATCHv2 bluetooth-next 1/4] ieee802154/atusb: Add function for partial register writes Stefan Schmidt
@ 2015-05-29 8:51 ` Stefan Schmidt
2015-05-29 9:19 ` Alexander Aring
2015-05-29 8:51 ` [PATCHv2 bluetooth-next 3/4] ieee802154/atusb: Add .set_promiscuous_mode driver operation Stefan Schmidt
` (4 subsequent siblings)
6 siblings, 1 reply; 11+ messages in thread
From: Stefan Schmidt @ 2015-05-29 8:51 UTC (permalink / raw)
To: linux-wpan; +Cc: Alexander Aring, Stefan Schmidt, Stefan Schmidt
From: Stefan Schmidt <s.schmidt@samsung.com>
Atusb uses the at86rf231 transceiver so we can use the same calculation
for txpower settings for it.
Signed-off-by: Stefan Schmidt <stefan@osg.samsung.com>
---
drivers/net/ieee802154/atusb.c | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/drivers/net/ieee802154/atusb.c b/drivers/net/ieee802154/atusb.c
index 95d4220..9805ebe 100644
--- a/drivers/net/ieee802154/atusb.c
+++ b/drivers/net/ieee802154/atusb.c
@@ -453,6 +453,26 @@ static void atusb_stop(struct ieee802154_hw *hw)
atusb_get_and_clear_error(atusb);
}
+#define ATUSB_MAX_TX_POWERS 0xF
+static const s32 atusb_powers[ATUSB_MAX_TX_POWERS + 1] = {
+ 300, 280, 230, 180, 130, 70, 0, -100, -200, -300, -400, -500, -700,
+ -900, -1200, -1700,
+};
+
+static int
+atusb_set_txpower(struct ieee802154_hw *hw, s32 mbm)
+{
+ struct atusb *atusb = hw->priv;
+ u32 i;
+
+ for (i = 0; i < hw->phy->supported.tx_powers_size; i++) {
+ if (hw->phy->supported.tx_powers[i] == mbm)
+ return atusb_write_subreg(atusb, SR_TX_PWR_23X, i);
+ }
+
+ return -EINVAL;
+}
+
static struct ieee802154_ops atusb_ops = {
.owner = THIS_MODULE,
.xmit_async = atusb_xmit,
@@ -461,6 +481,7 @@ static struct ieee802154_ops atusb_ops = {
.start = atusb_start,
.stop = atusb_stop,
.set_hw_addr_filt = atusb_set_hw_addr_filt,
+ .set_txpower = atusb_set_txpower,
};
/* ----- Firmware and chip version information ----------------------------- */
@@ -581,9 +602,14 @@ static int atusb_probe(struct usb_interface *interface,
hw->flags = IEEE802154_HW_TX_OMIT_CKSUM | IEEE802154_HW_AFILT |
IEEE802154_HW_AACK;
+ hw->phy->flags = WPAN_PHY_FLAG_TXPOWER;
+
hw->phy->current_page = 0;
hw->phy->current_channel = 11; /* reset default */
hw->phy->supported.channels[0] = 0x7FFF800;
+ hw->phy->supported.tx_powers = atusb_powers;
+ hw->phy->supported.tx_powers_size = ARRAY_SIZE(atusb_powers);
+ hw->phy->transmit_power = hw->phy->supported.tx_powers[0];
ieee802154_random_extended_addr(&hw->phy->perm_extended_addr);
atusb_command(atusb, ATUSB_RF_RESET, 0);
--
2.1.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCHv2 bluetooth-next 3/4] ieee802154/atusb: Add .set_promiscuous_mode driver operation
2015-05-29 8:51 [PATCHv2 bluetooth-next 0/4] Atusb driver improvements Stefan Schmidt
2015-05-29 8:51 ` [PATCHv2 bluetooth-next 1/4] ieee802154/atusb: Add function for partial register writes Stefan Schmidt
2015-05-29 8:51 ` [PATCHv2 bluetooth-next 2/4] ieee802154/atusb: Add .set_txpower operation to the driver Stefan Schmidt
@ 2015-05-29 8:51 ` Stefan Schmidt
2015-05-29 9:17 ` Alexander Aring
2015-05-29 8:51 ` [PATCHv2 bluetooth-next 4/4] MAINTAINERS: Add myself as maintainer for the atusb driver Stefan Schmidt
` (3 subsequent siblings)
6 siblings, 1 reply; 11+ messages in thread
From: Stefan Schmidt @ 2015-05-29 8:51 UTC (permalink / raw)
To: linux-wpan; +Cc: Alexander Aring, Stefan Schmidt, Stefan Schmidt
From: Stefan Schmidt <s.schmidt@samsung.com>
Allow monitor mode operation with disabled AACK in hardware.
Signed-off-by: Stefan Schmidt <stefan@osg.samsung.com>
---
drivers/net/ieee802154/atusb.c | 30 +++++++++++++++++++++++++++++-
1 file changed, 29 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ieee802154/atusb.c b/drivers/net/ieee802154/atusb.c
index 9805ebe..3d25678 100644
--- a/drivers/net/ieee802154/atusb.c
+++ b/drivers/net/ieee802154/atusb.c
@@ -473,6 +473,33 @@ atusb_set_txpower(struct ieee802154_hw *hw, s32 mbm)
return -EINVAL;
}
+static int
+atusb_set_promiscuous_mode(struct ieee802154_hw *hw, const bool on)
+{
+ struct atusb *atusb = hw->priv;
+ int ret;
+
+ if (on) {
+ ret = atusb_write_subreg(atusb, SR_AACK_DIS_ACK, 1);
+ if (ret < 0)
+ return ret;
+
+ ret = atusb_write_subreg(atusb, SR_AACK_PROM_MODE, 1);
+ if (ret < 0)
+ return ret;
+ } else {
+ ret = atusb_write_subreg(atusb, SR_AACK_PROM_MODE, 0);
+ if (ret < 0)
+ return ret;
+
+ ret = atusb_write_subreg(atusb, SR_AACK_DIS_ACK, 0);
+ if (ret < 0)
+ return ret;
+ }
+
+ return 0;
+}
+
static struct ieee802154_ops atusb_ops = {
.owner = THIS_MODULE,
.xmit_async = atusb_xmit,
@@ -482,6 +509,7 @@ static struct ieee802154_ops atusb_ops = {
.stop = atusb_stop,
.set_hw_addr_filt = atusb_set_hw_addr_filt,
.set_txpower = atusb_set_txpower,
+ .set_promiscuous_mode = atusb_set_promiscuous_mode,
};
/* ----- Firmware and chip version information ----------------------------- */
@@ -600,7 +628,7 @@ static int atusb_probe(struct usb_interface *interface,
hw->parent = &usb_dev->dev;
hw->flags = IEEE802154_HW_TX_OMIT_CKSUM | IEEE802154_HW_AFILT |
- IEEE802154_HW_AACK;
+ IEEE802154_HW_AACK | IEEE802154_HW_PROMISCUOUS;
hw->phy->flags = WPAN_PHY_FLAG_TXPOWER;
--
2.1.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCHv2 bluetooth-next 4/4] MAINTAINERS: Add myself as maintainer for the atusb driver
2015-05-29 8:51 [PATCHv2 bluetooth-next 0/4] Atusb driver improvements Stefan Schmidt
` (2 preceding siblings ...)
2015-05-29 8:51 ` [PATCHv2 bluetooth-next 3/4] ieee802154/atusb: Add .set_promiscuous_mode driver operation Stefan Schmidt
@ 2015-05-29 8:51 ` Stefan Schmidt
2015-05-29 9:03 ` [PATCHv2 bluetooth-next 0/4] Atusb driver improvements Varka Bhadram
` (2 subsequent siblings)
6 siblings, 0 replies; 11+ messages in thread
From: Stefan Schmidt @ 2015-05-29 8:51 UTC (permalink / raw)
To: linux-wpan; +Cc: Alexander Aring, Stefan Schmidt, Stefan Schmidt
From: Stefan Schmidt <s.schmidt@samsung.com>
Signed-off-by: Stefan Schmidt <stefan@osg.samsung.com>
---
MAINTAINERS | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/MAINTAINERS b/MAINTAINERS
index 5d87ccb..d69a7c1 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1860,6 +1860,14 @@ W: http://www.attotech.com
S: Supported
F: drivers/scsi/esas2r
+ATUSB IEEE 802.15.4 RADIO DRIVER
+M: Stefan Schmidt <stefan@osg.samsung.com>
+L: linux-wpan@vger.kernel.org
+S: Maintained
+F: drivers/net/ieee802154/atusb.c
+F: drivers/net/ieee802154/atusb.h
+F: drivers/net/ieee802154/at86rf230.h
+
AUDIT SUBSYSTEM
M: Paul Moore <paul@paul-moore.com>
M: Eric Paris <eparis@redhat.com>
--
2.1.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCHv2 bluetooth-next 0/4] Atusb driver improvements
2015-05-29 8:51 [PATCHv2 bluetooth-next 0/4] Atusb driver improvements Stefan Schmidt
` (3 preceding siblings ...)
2015-05-29 8:51 ` [PATCHv2 bluetooth-next 4/4] MAINTAINERS: Add myself as maintainer for the atusb driver Stefan Schmidt
@ 2015-05-29 9:03 ` Varka Bhadram
2015-05-29 9:39 ` Alexander Aring
2015-05-29 13:41 ` Marcel Holtmann
6 siblings, 0 replies; 11+ messages in thread
From: Varka Bhadram @ 2015-05-29 9:03 UTC (permalink / raw)
To: Stefan Schmidt, linux-wpan; +Cc: Alexander Aring
On 05/29/2015 02:21 PM, Stefan Schmidt wrote:
> Hello.
>
> Some patches to let the atusb driver catchup a bit with newer stack features.
> Namely we now support tx power and promiscuous mode setting. The first patch
> adds some infrastructure for this by adding a function to write parts of a
> register.
>
> The last patch adds me as the maintainer for the driver. Alex suggested that
> I should do this and as I have the device, working on the firmware as well
> and are motivated to enhance it I think its a good idea.
>
> Changes in v2:
> Fix checkpatch complains pointed out by Varka Bhadram
>
> Stefan Schmidt (4):
> ieee802154/atusb: Add function for partial register writes
> ieee802154/atusb: Add .set_txpower operation to the driver
> ieee802154/atusb: Add .set_promiscuous_mode driver operation
> MAINTAINERS: Add myself as maintainer for the atusb driver
>
> MAINTAINERS | 8 ++++
> drivers/net/ieee802154/atusb.c | 101 +++++++++++++++++++++++++++++++++--------
> 2 files changed, 90 insertions(+), 19 deletions(-)
>
> regards
> Stefan Schmidt
>
Reviewed-by: Varka Bhadram <varkabhadram@gmail.com>
--
Varka Bhadram
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCHv2 bluetooth-next 3/4] ieee802154/atusb: Add .set_promiscuous_mode driver operation
2015-05-29 8:51 ` [PATCHv2 bluetooth-next 3/4] ieee802154/atusb: Add .set_promiscuous_mode driver operation Stefan Schmidt
@ 2015-05-29 9:17 ` Alexander Aring
0 siblings, 0 replies; 11+ messages in thread
From: Alexander Aring @ 2015-05-29 9:17 UTC (permalink / raw)
To: Stefan Schmidt; +Cc: linux-wpan, Stefan Schmidt
Hi Stefan,
On Fri, May 29, 2015 at 10:51:27AM +0200, Stefan Schmidt wrote:
> From: Stefan Schmidt <s.schmidt@samsung.com>
>
> Allow monitor mode operation with disabled AACK in hardware.
>
> Signed-off-by: Stefan Schmidt <stefan@osg.samsung.com>
> ---
> drivers/net/ieee802154/atusb.c | 30 +++++++++++++++++++++++++++++-
> 1 file changed, 29 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ieee802154/atusb.c b/drivers/net/ieee802154/atusb.c
> index 9805ebe..3d25678 100644
> --- a/drivers/net/ieee802154/atusb.c
> +++ b/drivers/net/ieee802154/atusb.c
> @@ -473,6 +473,33 @@ atusb_set_txpower(struct ieee802154_hw *hw, s32 mbm)
> return -EINVAL;
> }
>
> +static int
> +atusb_set_promiscuous_mode(struct ieee802154_hw *hw, const bool on)
> +{
> + struct atusb *atusb = hw->priv;
> + int ret;
> +
> + if (on) {
> + ret = atusb_write_subreg(atusb, SR_AACK_DIS_ACK, 1);
> + if (ret < 0)
> + return ret;
> +
> + ret = atusb_write_subreg(atusb, SR_AACK_PROM_MODE, 1);
> + if (ret < 0)
> + return ret;
> + } else {
> + ret = atusb_write_subreg(atusb, SR_AACK_PROM_MODE, 0);
> + if (ret < 0)
> + return ret;
> +
> + ret = atusb_write_subreg(atusb, SR_AACK_DIS_ACK, 0);
> + if (ret < 0)
> + return ret;
> + }
> +
> + return 0;
> +}
> +
In case of rzusb which have an at86rf230 it doesn't support these
registers. There is no support for promiscuous mode. It's then a
broken behaviour when somebody sets this in rzusb.
Anyway rzusb isn't currently supported and I just want to leave a note
here. It's fine for me. Something for later to fix it in driver or
firmware handling.
- Alex
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCHv2 bluetooth-next 2/4] ieee802154/atusb: Add .set_txpower operation to the driver
2015-05-29 8:51 ` [PATCHv2 bluetooth-next 2/4] ieee802154/atusb: Add .set_txpower operation to the driver Stefan Schmidt
@ 2015-05-29 9:19 ` Alexander Aring
2015-05-29 9:27 ` Stefan Schmidt
0 siblings, 1 reply; 11+ messages in thread
From: Alexander Aring @ 2015-05-29 9:19 UTC (permalink / raw)
To: Stefan Schmidt; +Cc: linux-wpan, Stefan Schmidt
On Fri, May 29, 2015 at 10:51:26AM +0200, Stefan Schmidt wrote:
> From: Stefan Schmidt <s.schmidt@samsung.com>
>
> Atusb uses the at86rf231 transceiver so we can use the same calculation
> for txpower settings for it.
>
> Signed-off-by: Stefan Schmidt <stefan@osg.samsung.com>
> ---
> drivers/net/ieee802154/atusb.c | 26 ++++++++++++++++++++++++++
> 1 file changed, 26 insertions(+)
>
> diff --git a/drivers/net/ieee802154/atusb.c b/drivers/net/ieee802154/atusb.c
> index 95d4220..9805ebe 100644
> --- a/drivers/net/ieee802154/atusb.c
> +++ b/drivers/net/ieee802154/atusb.c
> @@ -453,6 +453,26 @@ static void atusb_stop(struct ieee802154_hw *hw)
> atusb_get_and_clear_error(atusb);
> }
>
> +#define ATUSB_MAX_TX_POWERS 0xF
> +static const s32 atusb_powers[ATUSB_MAX_TX_POWERS + 1] = {
> + 300, 280, 230, 180, 130, 70, 0, -100, -200, -300, -400, -500, -700,
> + -900, -1200, -1700,
> +};
> +
> +static int
> +atusb_set_txpower(struct ieee802154_hw *hw, s32 mbm)
> +{
> + struct atusb *atusb = hw->priv;
> + u32 i;
> +
> + for (i = 0; i < hw->phy->supported.tx_powers_size; i++) {
> + if (hw->phy->supported.tx_powers[i] == mbm)
> + return atusb_write_subreg(atusb, SR_TX_PWR_23X, i);
> + }
> +
> + return -EINVAL;
> +}
> +
also the mapping looks different in at86rf230. Anyway, it's just a note.
- Alex
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCHv2 bluetooth-next 2/4] ieee802154/atusb: Add .set_txpower operation to the driver
2015-05-29 9:19 ` Alexander Aring
@ 2015-05-29 9:27 ` Stefan Schmidt
0 siblings, 0 replies; 11+ messages in thread
From: Stefan Schmidt @ 2015-05-29 9:27 UTC (permalink / raw)
To: Alexander Aring; +Cc: linux-wpan, Stefan Schmidt
Hello.
On 29/05/15 11:19, Alexander Aring wrote:
> On Fri, May 29, 2015 at 10:51:26AM +0200, Stefan Schmidt wrote:
>> From: Stefan Schmidt <s.schmidt@samsung.com>
>>
>> Atusb uses the at86rf231 transceiver so we can use the same calculation
>> for txpower settings for it.
>>
>> Signed-off-by: Stefan Schmidt <stefan@osg.samsung.com>
>> ---
>> drivers/net/ieee802154/atusb.c | 26 ++++++++++++++++++++++++++
>> 1 file changed, 26 insertions(+)
>>
>> diff --git a/drivers/net/ieee802154/atusb.c b/drivers/net/ieee802154/atusb.c
>> index 95d4220..9805ebe 100644
>> --- a/drivers/net/ieee802154/atusb.c
>> +++ b/drivers/net/ieee802154/atusb.c
>> @@ -453,6 +453,26 @@ static void atusb_stop(struct ieee802154_hw *hw)
>> atusb_get_and_clear_error(atusb);
>> }
>>
>> +#define ATUSB_MAX_TX_POWERS 0xF
>> +static const s32 atusb_powers[ATUSB_MAX_TX_POWERS + 1] = {
>> + 300, 280, 230, 180, 130, 70, 0, -100, -200, -300, -400, -500, -700,
>> + -900, -1200, -1700,
>> +};
>> +
>> +static int
>> +atusb_set_txpower(struct ieee802154_hw *hw, s32 mbm)
>> +{
>> + struct atusb *atusb = hw->priv;
>> + u32 i;
>> +
>> + for (i = 0; i < hw->phy->supported.tx_powers_size; i++) {
>> + if (hw->phy->supported.tx_powers[i] == mbm)
>> + return atusb_write_subreg(atusb, SR_TX_PWR_23X, i);
>> + }
>> +
>> + return -EINVAL;
>> +}
>> +
> also the mapping looks different in at86rf230. Anyway, it's just a note.
Yeah, I think we can cross that bridge once we have the initial support
for raven. Same for the missing promiscuous mode.
As we will use a different product ID for the aven inside the firmware
we can easily detect what hardware we are running on and act accordingly
on the driver. Similar to what we already do in the at86rf230 driver for
230/233/212.
regards
Stefan Schmidt
> - Alex
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCHv2 bluetooth-next 0/4] Atusb driver improvements
2015-05-29 8:51 [PATCHv2 bluetooth-next 0/4] Atusb driver improvements Stefan Schmidt
` (4 preceding siblings ...)
2015-05-29 9:03 ` [PATCHv2 bluetooth-next 0/4] Atusb driver improvements Varka Bhadram
@ 2015-05-29 9:39 ` Alexander Aring
2015-05-29 13:41 ` Marcel Holtmann
6 siblings, 0 replies; 11+ messages in thread
From: Alexander Aring @ 2015-05-29 9:39 UTC (permalink / raw)
To: Stefan Schmidt; +Cc: linux-wpan
On Fri, May 29, 2015 at 10:51:24AM +0200, Stefan Schmidt wrote:
> Hello.
>
> Some patches to let the atusb driver catchup a bit with newer stack features.
> Namely we now support tx power and promiscuous mode setting. The first patch
> adds some infrastructure for this by adding a function to write parts of a
> register.
>
> The last patch adds me as the maintainer for the driver. Alex suggested that
> I should do this and as I have the device, working on the firmware as well
> and are motivated to enhance it I think its a good idea.
>
Acked-by: Alexander Aring <alex.aring@gmail.com>
on the complete series.
- Alex
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCHv2 bluetooth-next 0/4] Atusb driver improvements
2015-05-29 8:51 [PATCHv2 bluetooth-next 0/4] Atusb driver improvements Stefan Schmidt
` (5 preceding siblings ...)
2015-05-29 9:39 ` Alexander Aring
@ 2015-05-29 13:41 ` Marcel Holtmann
6 siblings, 0 replies; 11+ messages in thread
From: Marcel Holtmann @ 2015-05-29 13:41 UTC (permalink / raw)
To: Stefan Schmidt; +Cc: linux-wpan, Alexander Aring
Hi Stefan,
> Some patches to let the atusb driver catchup a bit with newer stack features.
> Namely we now support tx power and promiscuous mode setting. The first patch
> adds some infrastructure for this by adding a function to write parts of a
> register.
>
> The last patch adds me as the maintainer for the driver. Alex suggested that
> I should do this and as I have the device, working on the firmware as well
> and are motivated to enhance it I think its a good idea.
>
> Changes in v2:
> Fix checkpatch complains pointed out by Varka Bhadram
>
> Stefan Schmidt (4):
> ieee802154/atusb: Add function for partial register writes
> ieee802154/atusb: Add .set_txpower operation to the driver
> ieee802154/atusb: Add .set_promiscuous_mode driver operation
> MAINTAINERS: Add myself as maintainer for the atusb driver
>
> MAINTAINERS | 8 ++++
> drivers/net/ieee802154/atusb.c | 101 +++++++++++++++++++++++++++++++++--------
> 2 files changed, 90 insertions(+), 19 deletions(-)
all 4 patches have been applied to bluetooth-next tree.
Regards
Marcel
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2015-05-29 13:42 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-29 8:51 [PATCHv2 bluetooth-next 0/4] Atusb driver improvements Stefan Schmidt
2015-05-29 8:51 ` [PATCHv2 bluetooth-next 1/4] ieee802154/atusb: Add function for partial register writes Stefan Schmidt
2015-05-29 8:51 ` [PATCHv2 bluetooth-next 2/4] ieee802154/atusb: Add .set_txpower operation to the driver Stefan Schmidt
2015-05-29 9:19 ` Alexander Aring
2015-05-29 9:27 ` Stefan Schmidt
2015-05-29 8:51 ` [PATCHv2 bluetooth-next 3/4] ieee802154/atusb: Add .set_promiscuous_mode driver operation Stefan Schmidt
2015-05-29 9:17 ` Alexander Aring
2015-05-29 8:51 ` [PATCHv2 bluetooth-next 4/4] MAINTAINERS: Add myself as maintainer for the atusb driver Stefan Schmidt
2015-05-29 9:03 ` [PATCHv2 bluetooth-next 0/4] Atusb driver improvements Varka Bhadram
2015-05-29 9:39 ` Alexander Aring
2015-05-29 13:41 ` Marcel Holtmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox