All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Schmidt <stefan@osg.samsung.com>
To: linux-wpan@vger.kernel.org
Cc: Alexander Aring <alex.aring@gmail.com>,
	Stefan Schmidt <stefan@osg.samsung.com>
Subject: [PATCH bluetooth-next 1/4] ieee802154: atusb: implement .set_csma_params ops callback
Date: Tue, 19 Apr 2016 16:28:52 +0200	[thread overview]
Message-ID: <1461076135-31540-1-git-send-email-stefan@osg.samsung.com> (raw)

Catching up with the stack here and implement CSMA parameter setting.

Signed-off-by: Stefan Schmidt <stefan@osg.samsung.com>
---
 drivers/net/ieee802154/atusb.c | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ieee802154/atusb.c b/drivers/net/ieee802154/atusb.c
index b1cd865..2d8de9f 100644
--- a/drivers/net/ieee802154/atusb.c
+++ b/drivers/net/ieee802154/atusb.c
@@ -473,6 +473,23 @@ atusb_set_txpower(struct ieee802154_hw *hw, s32 mbm)
 }
 
 static int
+atusb_set_csma_params(struct ieee802154_hw *hw, u8 min_be, u8 max_be, u8 retries)
+{
+	struct atusb *atusb = hw->priv;
+	int ret;
+
+	ret = atusb_write_subreg(atusb, SR_MIN_BE, min_be);
+	if (ret)
+		return ret;
+
+	ret = atusb_write_subreg(atusb, SR_MAX_BE, max_be);
+	if (ret)
+		return ret;
+
+	return atusb_write_subreg(atusb, SR_MAX_CSMA_RETRIES, retries);
+}
+
+static int
 atusb_set_promiscuous_mode(struct ieee802154_hw *hw, const bool on)
 {
 	struct atusb *atusb = hw->priv;
@@ -508,6 +525,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_csma_params	= atusb_set_csma_params,
 	.set_promiscuous_mode	= atusb_set_promiscuous_mode,
 };
 
@@ -636,7 +654,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_PROMISCUOUS;
+		    IEEE802154_HW_PROMISCUOUS | IEEE802154_HW_CSMA_PARAMS;
 
 	hw->phy->flags = WPAN_PHY_FLAG_TXPOWER;
 
-- 
2.5.0


             reply	other threads:[~2016-04-19 14:38 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-19 14:28 Stefan Schmidt [this message]
2016-04-19 14:28 ` [PATCH bluetooth-next 2/4] ieee802154: atusb: implement .set_cca_ed_level ops callback Stefan Schmidt
2016-04-19 14:28 ` [PATCH bluetooth-next 3/4] ieee802154: atusb: implement .set_cca_mode " Stefan Schmidt
2016-04-19 14:28 ` [PATCH bluetooth-next 4/4] ieee802154: atusb: update my copyright years for this driver Stefan Schmidt
2016-04-20 18:55 ` [PATCH bluetooth-next 1/4] ieee802154: atusb: implement .set_csma_params ops callback Alexander Aring
2016-04-20 22:22   ` Marcel Holtmann
2016-04-21 10:00   ` Stefan Schmidt
2016-04-21 18:49     ` Stefan Schmidt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1461076135-31540-1-git-send-email-stefan@osg.samsung.com \
    --to=stefan@osg.samsung.com \
    --cc=alex.aring@gmail.com \
    --cc=linux-wpan@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.