cfg.c (70e71ca0af244f48a5dcf56dc435243792e3a495) cfg.c (ba2a9506a76450568cbc0d51626d94cf8528c0c7)
1/* This program is free software; you can redistribute it and/or modify
2 * it under the terms of the GNU General Public License version 2
3 * as published by the Free Software Foundation.
4 *
5 * This program is distributed in the hope that it will be useful,
6 * but WITHOUT ANY WARRANTY; without even the implied warranty of
7 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8 * GNU General Public License for more details.

--- 73 unchanged lines hidden (view full) ---

82 wpan_phy->current_page = page;
83 wpan_phy->current_channel = channel;
84 }
85
86 return ret;
87}
88
89static int
1/* This program is free software; you can redistribute it and/or modify
2 * it under the terms of the GNU General Public License version 2
3 * as published by the Free Software Foundation.
4 *
5 * This program is distributed in the hope that it will be useful,
6 * but WITHOUT ANY WARRANTY; without even the implied warranty of
7 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8 * GNU General Public License for more details.

--- 73 unchanged lines hidden (view full) ---

82 wpan_phy->current_page = page;
83 wpan_phy->current_channel = channel;
84 }
85
86 return ret;
87}
88
89static int
90ieee802154_set_cca_mode(struct wpan_phy *wpan_phy,
91 const struct wpan_phy_cca *cca)
92{
93 struct ieee802154_local *local = wpan_phy_priv(wpan_phy);
94 int ret;
95
96 ASSERT_RTNL();
97
98 /* check if phy support this setting */
99 if (!(local->hw.flags & IEEE802154_HW_CCA_MODE))
100 return -EOPNOTSUPP;
101
102 ret = drv_set_cca_mode(local, cca);
103 if (!ret)
104 wpan_phy->cca = *cca;
105
106 return ret;
107}
108
109static int
90ieee802154_set_pan_id(struct wpan_phy *wpan_phy, struct wpan_dev *wpan_dev,
91 __le16 pan_id)
92{
93 ASSERT_RTNL();
94
95 /* TODO
96 * I am not sure about to check here on broadcast pan_id.
97 * Broadcast is a valid setting, comment from 802.15.4:

--- 98 unchanged lines hidden (view full) ---

196}
197
198const struct cfg802154_ops mac802154_config_ops = {
199 .add_virtual_intf_deprecated = ieee802154_add_iface_deprecated,
200 .del_virtual_intf_deprecated = ieee802154_del_iface_deprecated,
201 .add_virtual_intf = ieee802154_add_iface,
202 .del_virtual_intf = ieee802154_del_iface,
203 .set_channel = ieee802154_set_channel,
110ieee802154_set_pan_id(struct wpan_phy *wpan_phy, struct wpan_dev *wpan_dev,
111 __le16 pan_id)
112{
113 ASSERT_RTNL();
114
115 /* TODO
116 * I am not sure about to check here on broadcast pan_id.
117 * Broadcast is a valid setting, comment from 802.15.4:

--- 98 unchanged lines hidden (view full) ---

216}
217
218const struct cfg802154_ops mac802154_config_ops = {
219 .add_virtual_intf_deprecated = ieee802154_add_iface_deprecated,
220 .del_virtual_intf_deprecated = ieee802154_del_iface_deprecated,
221 .add_virtual_intf = ieee802154_add_iface,
222 .del_virtual_intf = ieee802154_del_iface,
223 .set_channel = ieee802154_set_channel,
224 .set_cca_mode = ieee802154_set_cca_mode,
204 .set_pan_id = ieee802154_set_pan_id,
205 .set_short_addr = ieee802154_set_short_addr,
206 .set_backoff_exponent = ieee802154_set_backoff_exponent,
207 .set_max_csma_backoffs = ieee802154_set_max_csma_backoffs,
208 .set_max_frame_retries = ieee802154_set_max_frame_retries,
209 .set_lbt_mode = ieee802154_set_lbt_mode,
210};
225 .set_pan_id = ieee802154_set_pan_id,
226 .set_short_addr = ieee802154_set_short_addr,
227 .set_backoff_exponent = ieee802154_set_backoff_exponent,
228 .set_max_csma_backoffs = ieee802154_set_max_csma_backoffs,
229 .set_max_frame_retries = ieee802154_set_max_frame_retries,
230 .set_lbt_mode = ieee802154_set_lbt_mode,
231};