enum nl802154_cca_opts opt;
};
+static inline bool
+wpan_phy_cca_cmp(const struct wpan_phy_cca *a, const struct wpan_phy_cca *b)
+{
+ if (a->mode != b->mode)
+ return false;
+
+ if (a->mode == NL802154_CCA_ENERGY_CARRIER)
+ return a->opt == b->opt;
+
+ return true;
+}
+
struct wpan_phy {
struct mutex pib_lock;
ASSERT_RTNL();
+ if (wpan_phy->current_page == page &&
+ wpan_phy->current_channel == channel)
+ return 0;
+
ret = drv_set_channel(local, page, channel);
if (!ret) {
wpan_phy->current_page = page;
ASSERT_RTNL();
+ if (wpan_phy_cca_cmp(&wpan_phy->cca, cca))
+ return 0;
+
/* check if phy support this setting */
if (!(local->hw.flags & IEEE802154_HW_CCA_MODE))
return -EOPNOTSUPP;
{
ASSERT_RTNL();
+ if (wpan_dev->pan_id == pan_id)
+ return 0;
+
wpan_dev->pan_id = pan_id;
return 0;
}
ASSERT_RTNL();
+ if (wpan_dev->min_be == min_be &&
+ wpan_dev->max_be == max_be)
+ return 0;
+
if (!(local->hw.flags & IEEE802154_HW_CSMA_PARAMS))
return -EOPNOTSUPP;
{
ASSERT_RTNL();
+ if (wpan_dev->short_addr == short_addr)
+ return 0;
+
wpan_dev->short_addr = short_addr;
return 0;
}
ASSERT_RTNL();
+ if (wpan_dev->csma_retries == max_csma_backoffs)
+ return 0;
+
if (!(local->hw.flags & IEEE802154_HW_CSMA_PARAMS))
return -EOPNOTSUPP;
ASSERT_RTNL();
+ if (wpan_dev->frame_retries == max_frame_retries)
+ return 0;
+
if (!(local->hw.flags & IEEE802154_HW_FRAME_RETRIES))
return -EOPNOTSUPP;
ASSERT_RTNL();
+ if (wpan_dev->lbt == mode)
+ return 0;
+
if (!(local->hw.flags & IEEE802154_HW_LBT))
return -EOPNOTSUPP;