aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/ieee80211_i.h
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-07-26 11:24:39 -0400
committerJohannes Berg <johannes.berg@intel.com>2012-10-17 05:02:09 -0400
commit55de908ab292c03f1eb280f51170ddb9c6b57e31 (patch)
treebc75bb5cea581cadf6fe8b4f121cce02d07c276a /net/mac80211/ieee80211_i.h
parentfe57d9f5c0a2c1ef97ba8cdc42cfda5743f287b8 (diff)
mac80211: use channel contexts
Instead of operating on a single channel only, use the new channel context infrastructure in all mac80211 code. This enables drivers that want to use the new channel context infrastructure to use multiple channels, while nothing should change for all the other drivers that don't support it. Right now this disables both TX power settings and spatial multiplexing powersave. Both need to be re-enabled on a channel context basis. Additionally, when channel contexts are used drop the connection when channel switch is received rather than trying to handle it. This will have to be improved later. [With fixes from Eliad and Emmanuel incorporated] Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/ieee80211_i.h')
-rw-r--r--net/mac80211/ieee80211_i.h74
1 files changed, 56 insertions, 18 deletions
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 8fa00adcb8c0..6660118b46b3 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -773,6 +773,21 @@ struct ieee80211_sub_if_data *vif_to_sdata(struct ieee80211_vif *p)
773 return container_of(p, struct ieee80211_sub_if_data, vif); 773 return container_of(p, struct ieee80211_sub_if_data, vif);
774} 774}
775 775
776static inline enum ieee80211_band
777ieee80211_get_sdata_band(struct ieee80211_sub_if_data *sdata)
778{
779 enum ieee80211_band band = IEEE80211_BAND_2GHZ;
780 struct ieee80211_chanctx_conf *chanctx_conf;
781
782 rcu_read_lock();
783 chanctx_conf = rcu_dereference(sdata->vif.chanctx_conf);
784 if (!WARN_ON(!chanctx_conf))
785 band = chanctx_conf->channel->band;
786 rcu_read_unlock();
787
788 return band;
789}
790
776enum sdata_queue_type { 791enum sdata_queue_type {
777 IEEE80211_SDATA_QUEUE_TYPE_FRAME = 0, 792 IEEE80211_SDATA_QUEUE_TYPE_FRAME = 0,
778 IEEE80211_SDATA_QUEUE_AGG_START = 1, 793 IEEE80211_SDATA_QUEUE_AGG_START = 1,
@@ -1006,8 +1021,10 @@ struct ieee80211_local {
1006 enum mac80211_scan_state next_scan_state; 1021 enum mac80211_scan_state next_scan_state;
1007 struct delayed_work scan_work; 1022 struct delayed_work scan_work;
1008 struct ieee80211_sub_if_data __rcu *scan_sdata; 1023 struct ieee80211_sub_if_data __rcu *scan_sdata;
1024 struct ieee80211_channel *csa_channel;
1025 /* For backward compatibility only -- do not use */
1026 struct ieee80211_channel *_oper_channel;
1009 enum nl80211_channel_type _oper_channel_type; 1027 enum nl80211_channel_type _oper_channel_type;
1010 struct ieee80211_channel *oper_channel, *csa_channel;
1011 1028
1012 /* Temporary remain-on-channel for off-channel operations */ 1029 /* Temporary remain-on-channel for off-channel operations */
1013 struct ieee80211_channel *tmp_channel; 1030 struct ieee80211_channel *tmp_channel;
@@ -1121,6 +1138,8 @@ struct ieee80211_local {
1121 1138
1122 /* virtual monitor interface */ 1139 /* virtual monitor interface */
1123 struct ieee80211_sub_if_data __rcu *monitor_sdata; 1140 struct ieee80211_sub_if_data __rcu *monitor_sdata;
1141 struct ieee80211_channel *monitor_channel;
1142 enum nl80211_channel_type monitor_channel_type;
1124}; 1143};
1125 1144
1126static inline struct ieee80211_sub_if_data * 1145static inline struct ieee80211_sub_if_data *
@@ -1423,11 +1442,42 @@ void mac80211_ev_michael_mic_failure(struct ieee80211_sub_if_data *sdata, int ke
1423 gfp_t gfp); 1442 gfp_t gfp);
1424void ieee80211_set_wmm_default(struct ieee80211_sub_if_data *sdata, 1443void ieee80211_set_wmm_default(struct ieee80211_sub_if_data *sdata,
1425 bool bss_notify); 1444 bool bss_notify);
1426void ieee80211_xmit(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb); 1445void ieee80211_xmit(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb,
1446 enum ieee80211_band band);
1447
1448void __ieee80211_tx_skb_tid_band(struct ieee80211_sub_if_data *sdata,
1449 struct sk_buff *skb, int tid,
1450 enum ieee80211_band band);
1451
1452static inline void
1453ieee80211_tx_skb_tid_band(struct ieee80211_sub_if_data *sdata,
1454 struct sk_buff *skb, int tid,
1455 enum ieee80211_band band)
1456{
1457 rcu_read_lock();
1458 __ieee80211_tx_skb_tid_band(sdata, skb, tid, band);
1459 rcu_read_unlock();
1460}
1427 1461
1428void ieee80211_tx_skb_tid(struct ieee80211_sub_if_data *sdata, 1462static inline void ieee80211_tx_skb_tid(struct ieee80211_sub_if_data *sdata,
1429 struct sk_buff *skb, int tid); 1463 struct sk_buff *skb, int tid)
1430static void inline ieee80211_tx_skb(struct ieee80211_sub_if_data *sdata, 1464{
1465 struct ieee80211_chanctx_conf *chanctx_conf;
1466
1467 rcu_read_lock();
1468 chanctx_conf = rcu_dereference(sdata->vif.chanctx_conf);
1469 if (WARN_ON(!chanctx_conf)) {
1470 rcu_read_unlock();
1471 kfree_skb(skb);
1472 return;
1473 }
1474
1475 __ieee80211_tx_skb_tid_band(sdata, skb, tid,
1476 chanctx_conf->channel->band);
1477 rcu_read_unlock();
1478}
1479
1480static inline void ieee80211_tx_skb(struct ieee80211_sub_if_data *sdata,
1431 struct sk_buff *skb) 1481 struct sk_buff *skb)
1432{ 1482{
1433 /* Send all internal mgmt frames on VO. Accordingly set TID to 7. */ 1483 /* Send all internal mgmt frames on VO. Accordingly set TID to 7. */
@@ -1494,7 +1544,7 @@ void ieee80211_send_probe_req(struct ieee80211_sub_if_data *sdata, u8 *dst,
1494 const u8 *ssid, size_t ssid_len, 1544 const u8 *ssid, size_t ssid_len,
1495 const u8 *ie, size_t ie_len, 1545 const u8 *ie, size_t ie_len,
1496 u32 ratemask, bool directed, bool no_cck, 1546 u32 ratemask, bool directed, bool no_cck,
1497 struct ieee80211_channel *channel); 1547 struct ieee80211_channel *channel, bool scan);
1498 1548
1499void ieee80211_sta_def_wmm_params(struct ieee80211_sub_if_data *sdata, 1549void ieee80211_sta_def_wmm_params(struct ieee80211_sub_if_data *sdata,
1500 const size_t supp_rates_len, 1550 const size_t supp_rates_len,
@@ -1525,18 +1575,6 @@ int ieee80211_add_ext_srates_ie(struct ieee80211_sub_if_data *sdata,
1525 enum ieee80211_band band); 1575 enum ieee80211_band band);
1526 1576
1527/* channel management */ 1577/* channel management */
1528enum ieee80211_chan_mode {
1529 CHAN_MODE_UNDEFINED,
1530 CHAN_MODE_HOPPING,
1531 CHAN_MODE_FIXED,
1532};
1533
1534enum ieee80211_chan_mode
1535ieee80211_get_channel_mode(struct ieee80211_local *local,
1536 struct ieee80211_sub_if_data *ignore);
1537bool ieee80211_set_channel_type(struct ieee80211_local *local,
1538 struct ieee80211_sub_if_data *sdata,
1539 enum nl80211_channel_type chantype);
1540enum nl80211_channel_type 1578enum nl80211_channel_type
1541ieee80211_ht_oper_to_channel_type(struct ieee80211_ht_operation *ht_oper); 1579ieee80211_ht_oper_to_channel_type(struct ieee80211_ht_operation *ht_oper);
1542 1580