1*a1157835SDaniel Fojt /* 2*a1157835SDaniel Fojt * FST module - FST Session related definitions 3*a1157835SDaniel Fojt * Copyright (c) 2014, Qualcomm Atheros, Inc. 4*a1157835SDaniel Fojt * 5*a1157835SDaniel Fojt * This software may be distributed under the terms of the BSD license. 6*a1157835SDaniel Fojt * See README for more details. 7*a1157835SDaniel Fojt */ 8*a1157835SDaniel Fojt 9*a1157835SDaniel Fojt #ifndef FST_SESSION_H 10*a1157835SDaniel Fojt #define FST_SESSION_H 11*a1157835SDaniel Fojt 12*a1157835SDaniel Fojt #define FST_DEFAULT_SESSION_TIMEOUT_TU 255 /* u8 */ 13*a1157835SDaniel Fojt 14*a1157835SDaniel Fojt struct fst_iface; 15*a1157835SDaniel Fojt struct fst_group; 16*a1157835SDaniel Fojt struct fst_session; 17*a1157835SDaniel Fojt enum fst_session_state; 18*a1157835SDaniel Fojt 19*a1157835SDaniel Fojt int fst_session_global_init(void); 20*a1157835SDaniel Fojt void fst_session_global_deinit(void); 21*a1157835SDaniel Fojt void fst_session_global_on_iface_detached(struct fst_iface *iface); 22*a1157835SDaniel Fojt struct fst_session * 23*a1157835SDaniel Fojt fst_session_global_get_first_by_group(struct fst_group *g); 24*a1157835SDaniel Fojt 25*a1157835SDaniel Fojt struct fst_session * fst_session_create(struct fst_group *g); 26*a1157835SDaniel Fojt void fst_session_set_iface(struct fst_session *s, struct fst_iface *iface, 27*a1157835SDaniel Fojt Boolean is_old); 28*a1157835SDaniel Fojt void fst_session_set_llt(struct fst_session *s, u32 llt); 29*a1157835SDaniel Fojt void fst_session_set_peer_addr(struct fst_session *s, const u8 *addr, 30*a1157835SDaniel Fojt Boolean is_old); 31*a1157835SDaniel Fojt int fst_session_initiate_setup(struct fst_session *s); 32*a1157835SDaniel Fojt int fst_session_respond(struct fst_session *s, u8 status_code); 33*a1157835SDaniel Fojt int fst_session_initiate_switch(struct fst_session *s); 34*a1157835SDaniel Fojt void fst_session_handle_action(struct fst_session *s, struct fst_iface *iface, 35*a1157835SDaniel Fojt const struct ieee80211_mgmt *mgmt, 36*a1157835SDaniel Fojt size_t frame_len); 37*a1157835SDaniel Fojt int fst_session_tear_down_setup(struct fst_session *s); 38*a1157835SDaniel Fojt void fst_session_reset(struct fst_session *s); 39*a1157835SDaniel Fojt void fst_session_delete(struct fst_session *s); 40*a1157835SDaniel Fojt 41*a1157835SDaniel Fojt struct fst_group * fst_session_get_group(struct fst_session *s); 42*a1157835SDaniel Fojt struct fst_iface * fst_session_get_iface(struct fst_session *s, Boolean is_old); 43*a1157835SDaniel Fojt const u8 * fst_session_get_peer_addr(struct fst_session *s, Boolean is_old); 44*a1157835SDaniel Fojt u32 fst_session_get_id(struct fst_session *s); 45*a1157835SDaniel Fojt u32 fst_session_get_llt(struct fst_session *s); 46*a1157835SDaniel Fojt enum fst_session_state fst_session_get_state(struct fst_session *s); 47*a1157835SDaniel Fojt 48*a1157835SDaniel Fojt struct fst_session *fst_session_get_by_id(u32 id); 49*a1157835SDaniel Fojt 50*a1157835SDaniel Fojt typedef void (*fst_session_enum_clb)(struct fst_group *g, struct fst_session *s, 51*a1157835SDaniel Fojt void *ctx); 52*a1157835SDaniel Fojt 53*a1157835SDaniel Fojt void fst_session_enum(struct fst_group *g, fst_session_enum_clb clb, void *ctx); 54*a1157835SDaniel Fojt 55*a1157835SDaniel Fojt void fst_session_on_action_rx(struct fst_iface *iface, 56*a1157835SDaniel Fojt const struct ieee80211_mgmt *mgmt, size_t len); 57*a1157835SDaniel Fojt 58*a1157835SDaniel Fojt 59*a1157835SDaniel Fojt int fst_session_set_str_ifname(struct fst_session *s, const char *ifname, 60*a1157835SDaniel Fojt Boolean is_old); 61*a1157835SDaniel Fojt int fst_session_set_str_peer_addr(struct fst_session *s, const char *mac, 62*a1157835SDaniel Fojt Boolean is_old); 63*a1157835SDaniel Fojt int fst_session_set_str_llt(struct fst_session *s, const char *llt_str); 64*a1157835SDaniel Fojt 65*a1157835SDaniel Fojt #ifdef CONFIG_FST_TEST 66*a1157835SDaniel Fojt 67*a1157835SDaniel Fojt #define FST_FSTS_ID_NOT_FOUND ((u32) -1) 68*a1157835SDaniel Fojt 69*a1157835SDaniel Fojt int fst_test_req_send_fst_request(const char *params); 70*a1157835SDaniel Fojt int fst_test_req_send_fst_response(const char *params); 71*a1157835SDaniel Fojt int fst_test_req_send_ack_request(const char *params); 72*a1157835SDaniel Fojt int fst_test_req_send_ack_response(const char *params); 73*a1157835SDaniel Fojt int fst_test_req_send_tear_down(const char *params); 74*a1157835SDaniel Fojt u32 fst_test_req_get_fsts_id(const char *params); 75*a1157835SDaniel Fojt int fst_test_req_get_local_mbies(const char *request, char *buf, 76*a1157835SDaniel Fojt size_t buflen); 77*a1157835SDaniel Fojt 78*a1157835SDaniel Fojt #endif /* CONFIG_FST_TEST */ 79*a1157835SDaniel Fojt 80*a1157835SDaniel Fojt #endif /* FST_SESSION_H */ 81