diff options
author | John W. Linville <linville@tuxdriver.com> | 2011-03-07 16:19:18 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-03-11 15:34:10 -0500 |
commit | 38c091590f6ed78fcaf114c14ce133e5b3f717e6 (patch) | |
tree | 4293471c1babf894eb5e0bf69e919a4256b428c5 /net | |
parent | 3677713b799155c96637cdef3fa025e42f3fcf48 (diff) |
mac80211: implement support for cfg80211_ops->{get,set}_ringparam
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/mac80211/cfg.c | 17 | ||||
-rw-r--r-- | net/mac80211/driver-ops.h | 26 | ||||
-rw-r--r-- | net/mac80211/driver-trace.h | 52 |
3 files changed, 95 insertions, 0 deletions
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 | ||
2015 | static 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 | |||
2022 | static 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 | |||
2015 | struct cfg80211_ops mac80211_config_ops = { | 2030 | struct 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 | ||
529 | static 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 | |||
544 | static 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 | ||
915 | TRACE_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 | |||
938 | TRACE_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 | |||
915 | DEFINE_EVENT(local_only_evt, drv_offchannel_tx_cancel_wait, | 967 | DEFINE_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) |