aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Aring <alex.aring@gmail.com>2015-05-17 15:44:45 -0400
committerMarcel Holtmann <marcel@holtmann.org>2015-05-19 05:44:42 -0400
commit8329fcf11f5c2ae2fb7b1f56f05b0bb899babc85 (patch)
tree6d0723109ad1fc7bab4e2b758a9f122215547956
parent791021bf13ec9d0fc14bfd8c9c4b368ace568239 (diff)
mac802154: remove check if operation is supported
This patch removes the check if operation is supported by driver layer. This is done now by capabilities flags, if these are valid then the driver should support the operation, otherwise a WARN_ON occurs. Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
-rw-r--r--net/mac802154/cfg.c24
1 files changed, 0 insertions, 24 deletions
diff --git a/net/mac802154/cfg.c b/net/mac802154/cfg.c
index 45c4dc39766e..d5290ea49dca 100644
--- a/net/mac802154/cfg.c
+++ b/net/mac802154/cfg.c
@@ -98,10 +98,6 @@ ieee802154_set_cca_mode(struct wpan_phy *wpan_phy,
98 if (wpan_phy_cca_cmp(&wpan_phy->cca, cca)) 98 if (wpan_phy_cca_cmp(&wpan_phy->cca, cca))
99 return 0; 99 return 0;
100 100
101 /* check if phy support this setting */
102 if (!(local->hw.flags & IEEE802154_HW_CCA_MODE))
103 return -EOPNOTSUPP;
104
105 ret = drv_set_cca_mode(local, cca); 101 ret = drv_set_cca_mode(local, cca);
106 if (!ret) 102 if (!ret)
107 wpan_phy->cca = *cca; 103 wpan_phy->cca = *cca;
@@ -127,17 +123,12 @@ ieee802154_set_backoff_exponent(struct wpan_phy *wpan_phy,
127 struct wpan_dev *wpan_dev, 123 struct wpan_dev *wpan_dev,
128 u8 min_be, u8 max_be) 124 u8 min_be, u8 max_be)
129{ 125{
130 struct ieee802154_local *local = wpan_phy_priv(wpan_phy);
131
132 ASSERT_RTNL(); 126 ASSERT_RTNL();
133 127
134 if (wpan_dev->min_be == min_be && 128 if (wpan_dev->min_be == min_be &&
135 wpan_dev->max_be == max_be) 129 wpan_dev->max_be == max_be)
136 return 0; 130 return 0;
137 131
138 if (!(local->hw.flags & IEEE802154_HW_CSMA_PARAMS))
139 return -EOPNOTSUPP;
140
141 wpan_dev->min_be = min_be; 132 wpan_dev->min_be = min_be;
142 wpan_dev->max_be = max_be; 133 wpan_dev->max_be = max_be;
143 return 0; 134 return 0;
@@ -161,16 +152,11 @@ ieee802154_set_max_csma_backoffs(struct wpan_phy *wpan_phy,
161 struct wpan_dev *wpan_dev, 152 struct wpan_dev *wpan_dev,
162 u8 max_csma_backoffs) 153 u8 max_csma_backoffs)
163{ 154{
164 struct ieee802154_local *local = wpan_phy_priv(wpan_phy);
165
166 ASSERT_RTNL(); 155 ASSERT_RTNL();
167 156
168 if (wpan_dev->csma_retries == max_csma_backoffs) 157 if (wpan_dev->csma_retries == max_csma_backoffs)
169 return 0; 158 return 0;
170 159
171 if (!(local->hw.flags & IEEE802154_HW_CSMA_PARAMS))
172 return -EOPNOTSUPP;
173
174 wpan_dev->csma_retries = max_csma_backoffs; 160 wpan_dev->csma_retries = max_csma_backoffs;
175 return 0; 161 return 0;
176} 162}
@@ -180,16 +166,11 @@ ieee802154_set_max_frame_retries(struct wpan_phy *wpan_phy,
180 struct wpan_dev *wpan_dev, 166 struct wpan_dev *wpan_dev,
181 s8 max_frame_retries) 167 s8 max_frame_retries)
182{ 168{
183 struct ieee802154_local *local = wpan_phy_priv(wpan_phy);
184
185 ASSERT_RTNL(); 169 ASSERT_RTNL();
186 170
187 if (wpan_dev->frame_retries == max_frame_retries) 171 if (wpan_dev->frame_retries == max_frame_retries)
188 return 0; 172 return 0;
189 173
190 if (!(local->hw.flags & IEEE802154_HW_FRAME_RETRIES))
191 return -EOPNOTSUPP;
192
193 wpan_dev->frame_retries = max_frame_retries; 174 wpan_dev->frame_retries = max_frame_retries;
194 return 0; 175 return 0;
195} 176}
@@ -198,16 +179,11 @@ static int
198ieee802154_set_lbt_mode(struct wpan_phy *wpan_phy, struct wpan_dev *wpan_dev, 179ieee802154_set_lbt_mode(struct wpan_phy *wpan_phy, struct wpan_dev *wpan_dev,
199 bool mode) 180 bool mode)
200{ 181{
201 struct ieee802154_local *local = wpan_phy_priv(wpan_phy);
202
203 ASSERT_RTNL(); 182 ASSERT_RTNL();
204 183
205 if (wpan_dev->lbt == mode) 184 if (wpan_dev->lbt == mode)
206 return 0; 185 return 0;
207 186
208 if (!(local->hw.flags & IEEE802154_HW_LBT))
209 return -EOPNOTSUPP;
210
211 wpan_dev->lbt = mode; 187 wpan_dev->lbt = mode;
212 return 0; 188 return 0;
213} 189}