aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/cfg.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2015-06-02 15:39:54 -0400
committerJohannes Berg <johannes.berg@intel.com>2015-06-10 10:05:36 -0400
commit30686bf7f5b3c30831761e188a6e3cb33580fa48 (patch)
tree65be6b3ae5d661bf076af64855555f562fe356fd /net/mac80211/cfg.c
parent206c59d1d7d42bcafc1d7f1e476e87e4427e2345 (diff)
mac80211: convert HW flags to unsigned long bitmap
As we're running out of hardware capability flags pretty quickly, convert them to use the regular test_bit() style unsigned long bitmaps. This introduces a number of helper functions/macros to set and to test the bits, along with new debugfs code. The occurrences of an explicit __clear_bit() are intentional, the drivers were never supposed to change their supported bits on the fly. We should investigate changing this to be a per-frame flag. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/cfg.c')
-rw-r--r--net/mac80211/cfg.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 1d01190535b0..bf7023f6c327 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1763,7 +1763,7 @@ static int ieee80211_update_mesh_config(struct wiphy *wiphy,
1763 /* our RSSI threshold implementation is supported only for 1763 /* our RSSI threshold implementation is supported only for
1764 * devices that report signal in dBm. 1764 * devices that report signal in dBm.
1765 */ 1765 */
1766 if (!(sdata->local->hw.flags & IEEE80211_HW_SIGNAL_DBM)) 1766 if (!ieee80211_hw_check(&sdata->local->hw, SIGNAL_DBM))
1767 return -ENOTSUPP; 1767 return -ENOTSUPP;
1768 conf->rssi_threshold = nconf->rssi_threshold; 1768 conf->rssi_threshold = nconf->rssi_threshold;
1769 } 1769 }
@@ -2407,7 +2407,7 @@ static int ieee80211_set_power_mgmt(struct wiphy *wiphy, struct net_device *dev,
2407 if (sdata->vif.type != NL80211_IFTYPE_STATION) 2407 if (sdata->vif.type != NL80211_IFTYPE_STATION)
2408 return -EOPNOTSUPP; 2408 return -EOPNOTSUPP;
2409 2409
2410 if (!(local->hw.flags & IEEE80211_HW_SUPPORTS_PS)) 2410 if (!ieee80211_hw_check(&local->hw, SUPPORTS_PS))
2411 return -EOPNOTSUPP; 2411 return -EOPNOTSUPP;
2412 2412
2413 if (enabled == sdata->u.mgd.powersave && 2413 if (enabled == sdata->u.mgd.powersave &&
@@ -2422,7 +2422,7 @@ static int ieee80211_set_power_mgmt(struct wiphy *wiphy, struct net_device *dev,
2422 __ieee80211_request_smps_mgd(sdata, sdata->u.mgd.req_smps); 2422 __ieee80211_request_smps_mgd(sdata, sdata->u.mgd.req_smps);
2423 sdata_unlock(sdata); 2423 sdata_unlock(sdata);
2424 2424
2425 if (local->hw.flags & IEEE80211_HW_SUPPORTS_DYNAMIC_PS) 2425 if (ieee80211_hw_check(&local->hw, SUPPORTS_DYNAMIC_PS))
2426 ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_PS); 2426 ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_PS);
2427 2427
2428 ieee80211_recalc_ps(local, -1); 2428 ieee80211_recalc_ps(local, -1);
@@ -2466,7 +2466,7 @@ static int ieee80211_set_bitrate_mask(struct wiphy *wiphy,
2466 if (!ieee80211_sdata_running(sdata)) 2466 if (!ieee80211_sdata_running(sdata))
2467 return -ENETDOWN; 2467 return -ENETDOWN;
2468 2468
2469 if (local->hw.flags & IEEE80211_HW_HAS_RATE_CONTROL) { 2469 if (ieee80211_hw_check(&local->hw, HAS_RATE_CONTROL)) {
2470 ret = drv_set_bitrate_mask(local, sdata, mask); 2470 ret = drv_set_bitrate_mask(local, sdata, mask);
2471 if (ret) 2471 if (ret)
2472 return ret; 2472 return ret;
@@ -3451,7 +3451,7 @@ static int ieee80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
3451 3451
3452 IEEE80211_SKB_CB(skb)->flags |= IEEE80211_TX_CTL_TX_OFFCHAN | 3452 IEEE80211_SKB_CB(skb)->flags |= IEEE80211_TX_CTL_TX_OFFCHAN |
3453 IEEE80211_TX_INTFL_OFFCHAN_TX_OK; 3453 IEEE80211_TX_INTFL_OFFCHAN_TX_OK;
3454 if (local->hw.flags & IEEE80211_HW_QUEUE_CONTROL) 3454 if (ieee80211_hw_check(&local->hw, QUEUE_CONTROL))
3455 IEEE80211_SKB_CB(skb)->hw_queue = 3455 IEEE80211_SKB_CB(skb)->hw_queue =
3456 local->hw.offchannel_tx_hw_queue; 3456 local->hw.offchannel_tx_hw_queue;
3457 3457