2 * FST module - FST interface object implementation
3 * Copyright (c) 2014, Qualcomm Atheros, Inc.
5 * This software may be distributed under the terms of the BSD license.
6 * See README for more details.
9 #include "utils/includes.h"
10 #include "utils/common.h"
11 #include "fst/fst_internal.h"
12 #include "fst/fst_defs.h"
15 struct fst_iface * fst_iface_create(struct fst_group *g, const char *ifname,
17 const struct fst_wpa_obj *iface_obj,
18 const struct fst_iface_cfg *cfg)
22 i = os_zalloc(sizeof(*i));
24 fst_printf_group(g, MSG_ERROR, "cannot allocate iface for %s",
30 i->iface_obj = *iface_obj;
32 os_strlcpy(i->ifname, ifname, sizeof(i->ifname));
33 os_memcpy(i->own_addr, own_addr, sizeof(i->own_addr));
36 fst_printf_iface(i, MSG_WARNING, "Zero llt adjusted");
37 i->cfg.llt = FST_DEFAULT_LLT_CFG_VALUE;
44 void fst_iface_delete(struct fst_iface *i)
46 fst_iface_set_ies(i, NULL);
47 wpabuf_free(i->mb_ie);
52 Boolean fst_iface_is_connected(struct fst_iface *iface, const u8 *addr,
55 struct fst_get_peer_ctx *ctx;
56 const u8 *a = fst_iface_get_peer_first(iface, &ctx, mb_only);
58 for (; a != NULL; a = fst_iface_get_peer_next(iface, &ctx, mb_only))
59 if (os_memcmp(addr, a, ETH_ALEN) == 0)
66 void fst_iface_attach_mbie(struct fst_iface *i, struct wpabuf *mbie)
68 wpabuf_free(i->mb_ie);
73 enum mb_band_id fst_iface_get_band_id(struct fst_iface *i)
75 enum hostapd_hw_mode hw_mode;
78 fst_iface_get_channel_info(i, &hw_mode, &channel);
79 return fst_hw_mode_to_band(hw_mode);