From ba08fea53a43e02b590d89224afdad976dece841 Mon Sep 17 00:00:00 2001 From: Phoebe Buckheister Date: Mon, 17 Feb 2014 11:34:11 +0100 Subject: 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 Signed-off-by: David S. Miller --- drivers/net/ieee802154/at86rf230.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'drivers/net/ieee802154') 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) -- cgit v1.2.3