#ifndef __MAIN_H__
|
#define __MAIN_H__
|
|
#define LOG_TAG "SKW_WiFiHAL"
|
#include <log/log.h>
|
|
#include "wifi_hal.h"
|
|
#define OUI_GOOGLE 0x001A11
|
#define SKW_NR_IFACE 8
|
|
#define skw_nla_for_each_nested(pos, nla, rem) \
|
for (pos = (nlattr *)nla_data(nla), rem = nla_len(nla); \
|
nla_ok(pos, rem); \
|
pos = (nlattr *)nla_next(pos, &(rem)))
|
|
typedef struct {
|
int iface_idx; // id to use when talking to driver
|
int wdev_idx; // id to use when talking to driver
|
wifi_handle hal_handle; // handle to wifi data
|
char name[IFNAMSIZ+1]; // interface name + trailing null
|
} interface_info;
|
|
typedef struct {
|
struct nl_sock *nl_hal; // command socket object
|
struct nl_sock *nl_event; // event socket object
|
int family_nl80211; // family id for 80211 driver
|
|
bool exit; // Indication to exit since cleanup has started
|
int exit_socks[2]; // sockets used to implement wifi_cleanup
|
wifi_cleaned_up_handler cleaned_up_handler;
|
|
bool in_event_loop; // Indicates that event loop is active
|
|
pthread_mutex_t cb_lock; // mutex for the event_cb access
|
|
int num_cmd; // number of commands
|
int alloc_cmd; // number of commands allocated
|
|
int nr_interfaces;
|
interface_info interfaces[SKW_NR_IFACE];
|
wifi_interface_handle interface_handle[SKW_NR_IFACE];
|
|
int max_num_interfaces; // max number of interfaces
|
|
// add other details
|
} hal_info;
|
|
static inline hal_info *getHalInfo(wifi_interface_handle handle)
|
{
|
return (hal_info *)(((interface_info *)handle)->hal_handle);
|
}
|
#endif
|