aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorPhoebe Buckheister <phoebe.buckheister@itwm.fraunhofer.de>2014-02-17 11:34:11 +0100
committerDavid S. Miller <davem@davemloft.net>2014-02-17 16:42:38 -0500
commitba08fea53a43e02b590d89224afdad976dece841 (patch)
treeb7cfcfcfc9b923360c477e55df12a501eda169b0 /drivers
parentieee802154: add support for listen-before-talk in wpan_phy (diff)
downloadlinux-dev-ba08fea53a43e02b590d89224afdad976dece841.tar.xz
linux-dev-ba08fea53a43e02b590d89224afdad976dece841.zip
ieee802154: add support for CCA mode in wpan phys
The standard describes four modes of clear channel assesment: "energy above threshold", "carrier found", and the logical and/or of these two. Support for CCA mode setting is included in the at86rf230 driver, predicated for RF212 chips. Signed-off-by: Phoebe Buckheister <phoebe.buckheister@itwm.fraunhofer.de> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ieee802154/at86rf230.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/net/ieee802154/at86rf230.c b/drivers/net/ieee802154/at86rf230.c
index 3d40c2350261..c60871aff333 100644
--- a/drivers/net/ieee802154/at86rf230.c
+++ b/drivers/net/ieee802154/at86rf230.c
@@ -794,6 +794,14 @@ at86rf212_set_lbt(struct ieee802154_dev *dev, bool on)
return at86rf230_write_subreg(lp, SR_CSMA_LBT_MODE, on);
}
+static int
+at86rf212_set_cca_mode(struct ieee802154_dev *dev, u8 mode)
+{
+ struct at86rf230_local *lp = dev->priv;
+
+ return at86rf230_write_subreg(lp, SR_CCA_MODE, mode);
+}
+
static struct ieee802154_ops at86rf230_ops = {
.owner = THIS_MODULE,
.xmit = at86rf230_xmit,
@@ -814,6 +822,7 @@ static struct ieee802154_ops at86rf212_ops = {
.set_hw_addr_filt = at86rf230_set_hw_addr_filt,
.set_txpower = at86rf212_set_txpower,
.set_lbt = at86rf212_set_lbt,
+ .set_cca_mode = at86rf212_set_cca_mode,
};
static void at86rf230_irqwork(struct work_struct *work)