mac80211: support runtime interface type changes

Add support to mac80211 for changing the interface
type even when the interface is UP, if the driver
supports it.

To achieve this
 * add a new driver callback for switching,
 * split some of the interface up/down code out
   into new functions (do_open/do_stop), and
 * maintain an own __SDATA_RUNNING bit that will
   not be set during interface type, so that any
   other code doesn't use the interface.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
Johannes Berg
2010-08-27 12:35:58 +02:00
committed by John W. Linville
parent 87490f6db3
commit 34d4bc4d41
6 changed files with 185 additions and 37 deletions

View File

@ -136,6 +136,31 @@ TRACE_EVENT(drv_add_interface,
)
);
TRACE_EVENT(drv_change_interface,
TP_PROTO(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
enum nl80211_iftype type),
TP_ARGS(local, sdata, type),
TP_STRUCT__entry(
LOCAL_ENTRY
VIF_ENTRY
__field(u32, new_type)
),
TP_fast_assign(
LOCAL_ASSIGN;
VIF_ASSIGN;
__entry->new_type = type;
),
TP_printk(
LOCAL_PR_FMT VIF_PR_FMT " new type:%d",
LOCAL_PR_ARG, VIF_PR_ARG, __entry->new_type
)
);
TRACE_EVENT(drv_remove_interface,
TP_PROTO(struct ieee80211_local *local, struct ieee80211_sub_if_data *sdata),