aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2011-03-07 16:19:18 -0500
committerJohn W. Linville <linville@tuxdriver.com>2011-03-11 15:34:10 -0500
commit38c091590f6ed78fcaf114c14ce133e5b3f717e6 (patch)
tree4293471c1babf894eb5e0bf69e919a4256b428c5
parent3677713b799155c96637cdef3fa025e42f3fcf48 (diff)
mac80211: implement support for cfg80211_ops->{get,set}_ringparam
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--include/net/mac80211.h7
-rw-r--r--net/mac80211/cfg.c17
-rw-r--r--net/mac80211/driver-ops.h26
-rw-r--r--net/mac80211/driver-trace.h52
4 files changed, 102 insertions, 0 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 2b072fa99399..8650e7bf2ed0 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -1804,6 +1804,10 @@ enum ieee80211_ampdu_mlme_action {
1804 * return value is 1, then the @remain_on_channel will be used with a 1804 * return value is 1, then the @remain_on_channel will be used with a
1805 * regular transmission (if supported.) 1805 * regular transmission (if supported.)
1806 * @offchannel_tx_cancel_wait: cancel wait associated with offchannel TX 1806 * @offchannel_tx_cancel_wait: cancel wait associated with offchannel TX
1807 *
1808 * @set_ringparam: Set tx and rx ring sizes.
1809 *
1810 * @get_ringparam: Get tx and rx ring current and maximum sizes.
1807 */ 1811 */
1808struct ieee80211_ops { 1812struct ieee80211_ops {
1809 void (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb); 1813 void (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb);
@@ -1888,6 +1892,9 @@ struct ieee80211_ops {
1888 enum nl80211_channel_type channel_type, 1892 enum nl80211_channel_type channel_type,
1889 unsigned int wait); 1893 unsigned int wait);
1890 int (*offchannel_tx_cancel_wait)(struct ieee80211_hw *hw); 1894 int (*offchannel_tx_cancel_wait)(struct ieee80211_hw *hw);
1895 int (*set_ringparam)(struct ieee80211_hw *hw, u32 tx, u32 rx);
1896 void (*get_ringparam)(struct ieee80211_hw *hw,
1897 u32 *tx, u32 *tx_max, u32 *rx, u32 *rx_max);
1891}; 1898};
1892 1899
1893/** 1900/**
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 11866b42f1ed..334213571ad0 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -2012,6 +2012,21 @@ static int ieee80211_get_antenna(struct wiphy *wiphy, u32 *tx_ant, u32 *rx_ant)
2012 return drv_get_antenna(local, tx_ant, rx_ant); 2012 return drv_get_antenna(local, tx_ant, rx_ant);
2013} 2013}
2014 2014
2015static int ieee80211_set_ringparam(struct wiphy *wiphy, u32 tx, u32 rx)
2016{
2017 struct ieee80211_local *local = wiphy_priv(wiphy);
2018
2019 return drv_set_ringparam(local, tx, rx);
2020}
2021
2022static void ieee80211_get_ringparam(struct wiphy *wiphy,
2023 u32 *tx, u32 *tx_max, u32 *rx, u32 *rx_max)
2024{
2025 struct ieee80211_local *local = wiphy_priv(wiphy);
2026
2027 drv_get_ringparam(local, tx, tx_max, rx, rx_max);
2028}
2029
2015struct cfg80211_ops mac80211_config_ops = { 2030struct cfg80211_ops mac80211_config_ops = {
2016 .add_virtual_intf = ieee80211_add_iface, 2031 .add_virtual_intf = ieee80211_add_iface,
2017 .del_virtual_intf = ieee80211_del_iface, 2032 .del_virtual_intf = ieee80211_del_iface,
@@ -2069,4 +2084,6 @@ struct cfg80211_ops mac80211_config_ops = {
2069 .mgmt_frame_register = ieee80211_mgmt_frame_register, 2084 .mgmt_frame_register = ieee80211_mgmt_frame_register,
2070 .set_antenna = ieee80211_set_antenna, 2085 .set_antenna = ieee80211_set_antenna,
2071 .get_antenna = ieee80211_get_antenna, 2086 .get_antenna = ieee80211_get_antenna,
2087 .set_ringparam = ieee80211_set_ringparam,
2088 .get_ringparam = ieee80211_get_ringparam,
2072}; 2089};
diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h
index 3729296f6f95..9c0d62bb0ea3 100644
--- a/net/mac80211/driver-ops.h
+++ b/net/mac80211/driver-ops.h
@@ -526,4 +526,30 @@ static inline int drv_offchannel_tx_cancel_wait(struct ieee80211_local *local)
526 return ret; 526 return ret;
527} 527}
528 528
529static inline int drv_set_ringparam(struct ieee80211_local *local,
530 u32 tx, u32 rx)
531{
532 int ret = -ENOTSUPP;
533
534 might_sleep();
535
536 trace_drv_set_ringparam(local, tx, rx);
537 if (local->ops->set_ringparam)
538 ret = local->ops->set_ringparam(&local->hw, tx, rx);
539 trace_drv_return_int(local, ret);
540
541 return ret;
542}
543
544static inline void drv_get_ringparam(struct ieee80211_local *local,
545 u32 *tx, u32 *tx_max, u32 *rx, u32 *rx_max)
546{
547 might_sleep();
548
549 trace_drv_get_ringparam(local, tx, tx_max, rx, rx_max);
550 if (local->ops->get_ringparam)
551 local->ops->get_ringparam(&local->hw, tx, tx_max, rx, rx_max);
552 trace_drv_return_void(local);
553}
554
529#endif /* __MAC80211_DRIVER_OPS */ 555#endif /* __MAC80211_DRIVER_OPS */
diff --git a/net/mac80211/driver-trace.h b/net/mac80211/driver-trace.h
index 520fe2444893..45aab80738e2 100644
--- a/net/mac80211/driver-trace.h
+++ b/net/mac80211/driver-trace.h
@@ -912,6 +912,58 @@ TRACE_EVENT(drv_offchannel_tx,
912 ) 912 )
913); 913);
914 914
915TRACE_EVENT(drv_set_ringparam,
916 TP_PROTO(struct ieee80211_local *local, u32 tx, u32 rx),
917
918 TP_ARGS(local, tx, rx),
919
920 TP_STRUCT__entry(
921 LOCAL_ENTRY
922 __field(u32, tx)
923 __field(u32, rx)
924 ),
925
926 TP_fast_assign(
927 LOCAL_ASSIGN;
928 __entry->tx = tx;
929 __entry->rx = rx;
930 ),
931
932 TP_printk(
933 LOCAL_PR_FMT " tx:%d rx %d",
934 LOCAL_PR_ARG, __entry->tx, __entry->rx
935 )
936);
937
938TRACE_EVENT(drv_get_ringparam,
939 TP_PROTO(struct ieee80211_local *local, u32 *tx, u32 *tx_max,
940 u32 *rx, u32 *rx_max),
941
942 TP_ARGS(local, tx, tx_max, rx, rx_max),
943
944 TP_STRUCT__entry(
945 LOCAL_ENTRY
946 __field(u32, tx)
947 __field(u32, tx_max)
948 __field(u32, rx)
949 __field(u32, rx_max)
950 ),
951
952 TP_fast_assign(
953 LOCAL_ASSIGN;
954 __entry->tx = *tx;
955 __entry->tx_max = *tx_max;
956 __entry->rx = *rx;
957 __entry->rx_max = *rx_max;
958 ),
959
960 TP_printk(
961 LOCAL_PR_FMT " tx:%d tx_max %d rx %d rx_max %d",
962 LOCAL_PR_ARG,
963 __entry->tx, __entry->tx_max, __entry->rx, __entry->rx_max
964 )
965);
966
915DEFINE_EVENT(local_only_evt, drv_offchannel_tx_cancel_wait, 967DEFINE_EVENT(local_only_evt, drv_offchannel_tx_cancel_wait,
916 TP_PROTO(struct ieee80211_local *local), 968 TP_PROTO(struct ieee80211_local *local),
917 TP_ARGS(local) 969 TP_ARGS(local)