From 7c87f23e82a1801c4a48af9d439b59b0cac246eb Mon Sep 17 00:00:00 2001 From: Adrian Chadd Date: Sat, 31 Dec 2016 07:50:14 +0000 Subject: [PATCH] [net80211] add placeholders for the VHT action frame handling. Upcoming vht support will register send/receive action handlers. --- sys/net80211/ieee80211.h | 2 +- sys/net80211/ieee80211_action.c | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/sys/net80211/ieee80211.h b/sys/net80211/ieee80211.h index a9a82c3fea19..1fcff34cd379 100644 --- a/sys/net80211/ieee80211.h +++ b/sys/net80211/ieee80211.h @@ -382,7 +382,7 @@ struct ieee80211_action { #define IEEE80211_ACTION_CAT_MESH 13 /* Mesh */ #define IEEE80211_ACTION_CAT_SELF_PROT 15 /* Self-protected */ /* 16 - 125 reserved */ -#define IEEE80211_ACTION_VHT 21 +#define IEEE80211_ACTION_CAT_VHT 21 #define IEEE80211_ACTION_CAT_VENDOR 127 /* Vendor Specific */ #define IEEE80211_ACTION_HT_TXCHWIDTH 0 /* recommended xmit chan width*/ diff --git a/sys/net80211/ieee80211_action.c b/sys/net80211/ieee80211_action.c index a42b469e7c92..4021a5a826d3 100644 --- a/sys/net80211/ieee80211_action.c +++ b/sys/net80211/ieee80211_action.c @@ -79,6 +79,10 @@ static ieee80211_send_action_func *vendor_send_action[8] = { send_inval, send_inval, send_inval, send_inval, }; +static ieee80211_send_action_func *vht_send_action[3] = { + send_inval, send_inval, send_inval, +}; + int ieee80211_send_action_register(int cat, int act, ieee80211_send_action_func *f) { @@ -108,6 +112,11 @@ ieee80211_send_action_register(int cat, int act, ieee80211_send_action_func *f) break; vendor_send_action[act] = f; return 0; + case IEEE80211_ACTION_CAT_VHT: + if (act >= nitems(vht_send_action)) + break; + vht_send_action[act] = f; + return 0; } return EINVAL; } @@ -144,6 +153,10 @@ ieee80211_send_action(struct ieee80211_node *ni, int cat, int act, void *sa) if (act < nitems(vendor_send_action)) f = vendor_send_action[act]; break; + case IEEE80211_ACTION_CAT_VHT: + if (act < nitems(vht_send_action)) + f = vht_send_action[act]; + break; } return f(ni, cat, act, sa); } @@ -177,6 +190,10 @@ static ieee80211_recv_action_func *vendor_recv_action[8] = { recv_inval, recv_inval, recv_inval, recv_inval, }; +static ieee80211_recv_action_func *vht_recv_action[3] = { + recv_inval, recv_inval, recv_inval +}; + int ieee80211_recv_action_register(int cat, int act, ieee80211_recv_action_func *f) { @@ -206,6 +223,11 @@ ieee80211_recv_action_register(int cat, int act, ieee80211_recv_action_func *f) break; vendor_recv_action[act] = f; return 0; + case IEEE80211_ACTION_CAT_VHT: + if (act >= nitems(vht_recv_action)) + break; + vht_recv_action[act] = f; + return 0; } return EINVAL; } @@ -256,6 +278,10 @@ ieee80211_recv_action(struct ieee80211_node *ni, if (ia->ia_action < nitems(vendor_recv_action)) f = vendor_recv_action[ia->ia_action]; break; + case IEEE80211_ACTION_CAT_VHT: + if (ia->ia_action < nitems(vht_recv_action)) + f = vht_recv_action[ia->ia_action]; + break; } return f(ni, wh, frm, efrm); }