aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorMichal Kazior <michal.kazior@tieto.com>2012-06-26 08:37:17 -0400
committerJohannes Berg <johannes.berg@intel.com>2012-10-16 14:22:42 -0400
commitc3645eac479d9aaac9f8099c94bf681dc695dd34 (patch)
treef701eb4d7b3449d9f4672590f752081ea92f2009 /net/mac80211
parentd01a1e658606a0a69100f49c2ef09aacaf74d3e7 (diff)
mac80211: introduce new ieee80211_ops
Introduce channel context driver methods. The channel on a context channel is immutable, but the channel type and other properties can change. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/driver-ops.h65
-rw-r--r--net/mac80211/trace.h107
2 files changed, 172 insertions, 0 deletions
diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h
index da9003b20004..77407b31e1ff 100644
--- a/net/mac80211/driver-ops.h
+++ b/net/mac80211/driver-ops.h
@@ -871,4 +871,69 @@ static inline void drv_mgd_prepare_tx(struct ieee80211_local *local,
871 local->ops->mgd_prepare_tx(&local->hw, &sdata->vif); 871 local->ops->mgd_prepare_tx(&local->hw, &sdata->vif);
872 trace_drv_return_void(local); 872 trace_drv_return_void(local);
873} 873}
874
875static inline int drv_add_chanctx(struct ieee80211_local *local,
876 struct ieee80211_chanctx *ctx)
877{
878 int ret = -EOPNOTSUPP;
879
880 trace_drv_add_chanctx(local, ctx);
881 if (local->ops->add_chanctx)
882 ret = local->ops->add_chanctx(&local->hw, &ctx->conf);
883 trace_drv_return_int(local, ret);
884
885 return ret;
886}
887
888static inline void drv_remove_chanctx(struct ieee80211_local *local,
889 struct ieee80211_chanctx *ctx)
890{
891 trace_drv_remove_chanctx(local, ctx);
892 if (local->ops->remove_chanctx)
893 local->ops->remove_chanctx(&local->hw, &ctx->conf);
894 trace_drv_return_void(local);
895}
896
897static inline void drv_change_chanctx(struct ieee80211_local *local,
898 struct ieee80211_chanctx *ctx,
899 u32 changed)
900{
901 trace_drv_change_chanctx(local, ctx, changed);
902 if (local->ops->change_chanctx)
903 local->ops->change_chanctx(&local->hw, &ctx->conf, changed);
904 trace_drv_return_void(local);
905}
906
907static inline int drv_assign_vif_chanctx(struct ieee80211_local *local,
908 struct ieee80211_sub_if_data *sdata,
909 struct ieee80211_chanctx *ctx)
910{
911 int ret = 0;
912
913 check_sdata_in_driver(sdata);
914
915 trace_drv_assign_vif_chanctx(local, sdata, ctx);
916 if (local->ops->assign_vif_chanctx)
917 ret = local->ops->assign_vif_chanctx(&local->hw,
918 &sdata->vif,
919 &ctx->conf);
920 trace_drv_return_int(local, ret);
921
922 return ret;
923}
924
925static inline void drv_unassign_vif_chanctx(struct ieee80211_local *local,
926 struct ieee80211_sub_if_data *sdata,
927 struct ieee80211_chanctx *ctx)
928{
929 check_sdata_in_driver(sdata);
930
931 trace_drv_unassign_vif_chanctx(local, sdata, ctx);
932 if (local->ops->unassign_vif_chanctx)
933 local->ops->unassign_vif_chanctx(&local->hw,
934 &sdata->vif,
935 &ctx->conf);
936 trace_drv_return_void(local);
937}
938
874#endif /* __MAC80211_DRIVER_OPS */ 939#endif /* __MAC80211_DRIVER_OPS */
diff --git a/net/mac80211/trace.h b/net/mac80211/trace.h
index 18d9c8a52e9e..a3f5fe2a84a8 100644
--- a/net/mac80211/trace.h
+++ b/net/mac80211/trace.h
@@ -28,6 +28,15 @@
28#define VIF_PR_FMT " vif:%s(%d%s)" 28#define VIF_PR_FMT " vif:%s(%d%s)"
29#define VIF_PR_ARG __get_str(vif_name), __entry->vif_type, __entry->p2p ? "/p2p" : "" 29#define VIF_PR_ARG __get_str(vif_name), __entry->vif_type, __entry->p2p ? "/p2p" : ""
30 30
31#define CHANCTX_ENTRY __field(int, freq) \
32 __field(int, chantype)
33#define CHANCTX_ASSIGN __entry->freq = ctx->conf.channel->center_freq; \
34 __entry->chantype = ctx->conf.channel_type
35#define CHANCTX_PR_FMT " freq:%d MHz chantype:%d"
36#define CHANCTX_PR_ARG __entry->freq, __entry->chantype
37
38
39
31/* 40/*
32 * Tracing for driver callbacks. 41 * Tracing for driver callbacks.
33 */ 42 */
@@ -1256,6 +1265,104 @@ DEFINE_EVENT(local_sdata_evt, drv_mgd_prepare_tx,
1256 TP_ARGS(local, sdata) 1265 TP_ARGS(local, sdata)
1257); 1266);
1258 1267
1268DECLARE_EVENT_CLASS(local_chanctx,
1269 TP_PROTO(struct ieee80211_local *local,
1270 struct ieee80211_chanctx *ctx),
1271
1272 TP_ARGS(local, ctx),
1273
1274 TP_STRUCT__entry(
1275 LOCAL_ENTRY
1276 CHANCTX_ENTRY
1277 ),
1278
1279 TP_fast_assign(
1280 LOCAL_ASSIGN;
1281 CHANCTX_ASSIGN;
1282 ),
1283
1284 TP_printk(
1285 LOCAL_PR_FMT CHANCTX_PR_FMT,
1286 LOCAL_PR_ARG, CHANCTX_PR_ARG
1287 )
1288);
1289
1290DEFINE_EVENT(local_chanctx, drv_add_chanctx,
1291 TP_PROTO(struct ieee80211_local *local,
1292 struct ieee80211_chanctx *ctx),
1293 TP_ARGS(local, ctx)
1294);
1295
1296DEFINE_EVENT(local_chanctx, drv_remove_chanctx,
1297 TP_PROTO(struct ieee80211_local *local,
1298 struct ieee80211_chanctx *ctx),
1299 TP_ARGS(local, ctx)
1300);
1301
1302TRACE_EVENT(drv_change_chanctx,
1303 TP_PROTO(struct ieee80211_local *local,
1304 struct ieee80211_chanctx *ctx,
1305 u32 changed),
1306
1307 TP_ARGS(local, ctx, changed),
1308
1309 TP_STRUCT__entry(
1310 LOCAL_ENTRY
1311 CHANCTX_ENTRY
1312 __field(u32, changed)
1313 ),
1314
1315 TP_fast_assign(
1316 LOCAL_ASSIGN;
1317 CHANCTX_ASSIGN;
1318 __entry->changed = changed;
1319 ),
1320
1321 TP_printk(
1322 LOCAL_PR_FMT CHANCTX_PR_FMT " changed:%#x",
1323 LOCAL_PR_ARG, CHANCTX_PR_ARG, __entry->changed
1324 )
1325);
1326
1327DECLARE_EVENT_CLASS(local_sdata_chanctx,
1328 TP_PROTO(struct ieee80211_local *local,
1329 struct ieee80211_sub_if_data *sdata,
1330 struct ieee80211_chanctx *ctx),
1331
1332 TP_ARGS(local, sdata, ctx),
1333
1334 TP_STRUCT__entry(
1335 LOCAL_ENTRY
1336 VIF_ENTRY
1337 CHANCTX_ENTRY
1338 ),
1339
1340 TP_fast_assign(
1341 LOCAL_ASSIGN;
1342 VIF_ASSIGN;
1343 CHANCTX_ASSIGN;
1344 ),
1345
1346 TP_printk(
1347 LOCAL_PR_FMT VIF_PR_FMT CHANCTX_PR_FMT,
1348 LOCAL_PR_ARG, VIF_PR_ARG, CHANCTX_PR_ARG
1349 )
1350);
1351
1352DEFINE_EVENT(local_sdata_chanctx, drv_assign_vif_chanctx,
1353 TP_PROTO(struct ieee80211_local *local,
1354 struct ieee80211_sub_if_data *sdata,
1355 struct ieee80211_chanctx *ctx),
1356 TP_ARGS(local, sdata, ctx)
1357);
1358
1359DEFINE_EVENT(local_sdata_chanctx, drv_unassign_vif_chanctx,
1360 TP_PROTO(struct ieee80211_local *local,
1361 struct ieee80211_sub_if_data *sdata,
1362 struct ieee80211_chanctx *ctx),
1363 TP_ARGS(local, sdata, ctx)
1364);
1365
1259/* 1366/*
1260 * Tracing for API calls that drivers call. 1367 * Tracing for API calls that drivers call.
1261 */ 1368 */