u16 id;
union message_body body;
struct host_if_drv *drv;
+ struct wilc_vif *vif;
};
struct join_bss_param {
return result;
}
-static s32 host_int_get_ipaddress(struct host_if_drv *hif_drv, u8 *u16ipadd, u8 idx);
+static s32 host_int_get_ipaddress(struct wilc_vif *vif,
+ struct host_if_drv *hif_drv,
+ u8 *u16ipadd, u8 idx);
-static s32 handle_set_ip_address(struct host_if_drv *hif_drv, u8 *ip_addr, u8 idx)
+static s32 handle_set_ip_address(struct wilc_vif *vif,
+ struct host_if_drv *hif_drv, u8 *ip_addr,
+ u8 idx)
{
s32 result = 0;
struct wid wid;
result = wilc_send_config_pkt(hif_drv->wilc, SET_CFG, &wid, 1,
get_id_from_handler(hif_drv));
- host_int_get_ipaddress(hif_drv, firmware_ip_addr, idx);
+ host_int_get_ipaddress(vif, hif_drv, firmware_ip_addr, idx);
if (result) {
PRINT_ER("Failed to set IP address\n");
return result;
}
-static s32 handle_get_ip_address(struct host_if_drv *hif_drv, u8 idx)
+static s32 handle_get_ip_address(struct wilc_vif *vif,
+ struct host_if_drv *hif_drv, u8 idx)
{
s32 result = 0;
struct wid wid;
kfree(wid.val);
if (memcmp(get_ip[idx], set_ip[idx], IP_ALEN) != 0)
- wilc_setup_ipaddress(hif_drv, set_ip[idx], idx);
+ wilc_setup_ipaddress(vif, hif_drv, set_ip[idx], idx);
if (result != 0) {
PRINT_ER("Failed to get IP address\n");
u32 u32MaxAssocRespInfoLen,
u32 *pu32RcvdAssocRespInfoLen);
-static s32 Handle_RcvdGnrlAsyncInfo(struct host_if_drv *hif_drv,
+static s32 Handle_RcvdGnrlAsyncInfo(struct wilc_vif *vif,
+ struct host_if_drv *hif_drv,
struct rcvd_async_info *pstrRcvdGnrlAsyncInfo)
{
s32 result = 0;
if ((u8MacStatus == MAC_CONNECTED) &&
(strConnectInfo.u16ConnectStatus == SUCCESSFUL_STATUSCODE)) {
- wilc_set_power_mgmt(hif_drv, 0, 0);
+ wilc_set_power_mgmt(vif, hif_drv, 0, 0);
PRINT_D(HOSTINF_DBG, "MAC status : CONNECTED and Connect Status : Successful\n");
hif_drv->hif_state = HOST_IF_CONNECTED;
if (hif_drv->usr_conn_req.conn_result) {
wilc_optaining_ip = false;
- wilc_set_power_mgmt(hif_drv, 0, 0);
+ wilc_set_power_mgmt(vif, hif_drv, 0, 0);
hif_drv->usr_conn_req.conn_result(CONN_DISCONN_EVENT_DISCONN_NOTIF,
NULL,
return result;
}
-static void Handle_Disconnect(struct host_if_drv *hif_drv)
+static void Handle_Disconnect(struct wilc_vif *vif,
+ struct host_if_drv *hif_drv)
{
struct wid wid;
PRINT_D(HOSTINF_DBG, "Sending disconnect request\n");
wilc_optaining_ip = false;
- wilc_set_power_mgmt(hif_drv, 0, 0);
+ wilc_set_power_mgmt(vif, hif_drv, 0, 0);
eth_zero_addr(wilc_connected_ssid);
up(&hif_drv->sem_test_disconn_block);
}
-void wilc_resolve_disconnect_aberration(struct host_if_drv *hif_drv)
+void wilc_resolve_disconnect_aberration(struct wilc_vif *vif,
+ struct host_if_drv *hif_drv)
{
if (!hif_drv)
return;
if ((hif_drv->hif_state == HOST_IF_WAITING_CONN_RESP) ||
(hif_drv->hif_state == HOST_IF_CONNECTING)) {
PRINT_D(HOSTINF_DBG, "\n\n<< correcting Supplicant state machine >>\n\n");
- wilc_disconnect(hif_drv, 1);
+ wilc_disconnect(vif, hif_drv, 1);
}
}
struct host_if_msg msg;
struct host_if_drv *hif_drv;
struct wilc *wilc = (struct wilc*)pvArg;
+ struct wilc_vif *vif;
memset(&msg, 0, sizeof(struct host_if_msg));
while (1) {
wilc_mq_recv(&hif_msg_q, &msg, sizeof(struct host_if_msg), &u32Ret);
hif_drv = (struct host_if_drv *)msg.drv;
+ vif = msg.vif;
if (msg.id == HOST_IF_MSG_EXIT) {
PRINT_D(GENERIC_DBG, "THREAD: Exiting HostIfThread\n");
break;
break;
case HOST_IF_MSG_RCVD_GNRL_ASYNC_INFO:
- Handle_RcvdGnrlAsyncInfo(msg.drv, &msg.body.async_info);
+ Handle_RcvdGnrlAsyncInfo(vif, msg.drv,
+ &msg.body.async_info);
break;
case HOST_IF_MSG_KEY:
break;
case HOST_IF_MSG_DISCONNECT:
- Handle_Disconnect(msg.drv);
+ Handle_Disconnect(vif, msg.drv);
break;
case HOST_IF_MSG_RCVD_SCAN_COMPLETE:
case HOST_IF_MSG_SET_IPADDRESS:
PRINT_D(HOSTINF_DBG, "HOST_IF_MSG_SET_IPADDRESS\n");
- handle_set_ip_address(msg.drv,
+ handle_set_ip_address(vif, msg.drv,
msg.body.ip_info.ip_addr,
msg.body.ip_info.idx);
break;
case HOST_IF_MSG_GET_IPADDRESS:
PRINT_D(HOSTINF_DBG, "HOST_IF_MSG_SET_IPADDRESS\n");
- handle_get_ip_address(msg.drv, msg.body.ip_info.idx);
+ handle_get_ip_address(vif, msg.drv,
+ msg.body.ip_info.idx);
break;
case HOST_IF_MSG_SET_MAC_ADDRESS:
return 0;
}
-int wilc_remove_wep_key(struct host_if_drv *hif_drv, u8 index)
+int wilc_remove_wep_key(struct wilc_vif *vif,
+ struct host_if_drv *hif_drv, u8 index)
{
int result = 0;
struct host_if_msg msg;
msg.body.key_info.type = WEP;
msg.body.key_info.action = REMOVEKEY;
msg.drv = hif_drv;
+ msg.vif = vif;
msg.body.key_info.attr.wep.index = index;
result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
return result;
}
-int wilc_set_wep_default_keyid(struct host_if_drv *hif_drv, u8 index)
+int wilc_set_wep_default_keyid(struct wilc_vif *vif,
+ struct host_if_drv *hif_drv, u8 index)
{
int result = 0;
struct host_if_msg msg;
msg.body.key_info.type = WEP;
msg.body.key_info.action = DEFAULTKEY;
msg.drv = hif_drv;
+ msg.vif = vif;
msg.body.key_info.attr.wep.index = index;
result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
return result;
}
-int wilc_add_wep_key_bss_sta(struct host_if_drv *hif_drv,
- const u8 *key,
- u8 len,
- u8 index)
+int wilc_add_wep_key_bss_sta(struct wilc_vif *vif, struct host_if_drv *hif_drv,
+ const u8 *key, u8 len, u8 index)
{
int result = 0;
struct host_if_msg msg;
msg.body.key_info.type = WEP;
msg.body.key_info.action = ADDKEY;
msg.drv = hif_drv;
+ msg.vif = vif;
msg.body.key_info.attr.wep.key = kmemdup(key, len, GFP_KERNEL);
if (!msg.body.key_info.attr.wep.key)
return -ENOMEM;
return result;
}
-int wilc_add_wep_key_bss_ap(struct host_if_drv *hif_drv,
- const u8 *key,
- u8 len,
- u8 index,
- u8 mode,
+int wilc_add_wep_key_bss_ap(struct wilc_vif *vif, struct host_if_drv *hif_drv,
+ const u8 *key, u8 len, u8 index, u8 mode,
enum AUTHTYPE auth_type)
{
int result = 0;
msg.body.key_info.type = WEP;
msg.body.key_info.action = ADDKEY_AP;
msg.drv = hif_drv;
+ msg.vif = vif;
msg.body.key_info.attr.wep.key = kmemdup(key, len, GFP_KERNEL);
if (!msg.body.key_info.attr.wep.key)
return -ENOMEM;
return result;
}
-int wilc_add_ptk(struct host_if_drv *hif_drv, const u8 *ptk,
- u8 ptk_key_len, const u8 *mac_addr,
- const u8 *rx_mic, const u8 *tx_mic,
- u8 mode, u8 cipher_mode, u8 index)
+int wilc_add_ptk(struct wilc_vif *vif, struct host_if_drv *hif_drv,
+ const u8 *ptk, u8 ptk_key_len, const u8 *mac_addr,
+ const u8 *rx_mic, const u8 *tx_mic, u8 mode, u8 cipher_mode,
+ u8 index)
{
int result = 0;
struct host_if_msg msg;
msg.body.key_info.attr.wpa.mac_addr = mac_addr;
msg.body.key_info.attr.wpa.mode = cipher_mode;
msg.drv = hif_drv;
+ msg.vif = vif;
result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
return result;
}
-int wilc_add_rx_gtk(struct host_if_drv *hif_drv, const u8 *rx_gtk,
- u8 gtk_key_len, u8 index,
- u32 key_rsc_len, const u8 *key_rsc,
- const u8 *rx_mic, const u8 *tx_mic,
- u8 mode, u8 cipher_mode)
+int wilc_add_rx_gtk(struct wilc_vif *vif, struct host_if_drv *hif_drv,
+ const u8 *rx_gtk, u8 gtk_key_len, u8 index,
+ u32 key_rsc_len, const u8 *key_rsc, const u8 *rx_mic,
+ const u8 *tx_mic, u8 mode, u8 cipher_mode)
{
int result = 0;
struct host_if_msg msg;
msg.id = HOST_IF_MSG_KEY;
msg.body.key_info.type = WPA_RX_GTK;
msg.drv = hif_drv;
+ msg.vif = vif;
if (mode == AP_MODE) {
msg.body.key_info.action = ADDKEY_AP;
return result;
}
-s32 wilc_set_pmkid_info(struct host_if_drv *hif_drv, struct host_if_pmkid_attr *pu8PmkidInfoArray)
+s32 wilc_set_pmkid_info(struct wilc_vif *vif, struct host_if_drv *hif_drv,
+ struct host_if_pmkid_attr *pu8PmkidInfoArray)
{
s32 result = 0;
struct host_if_msg msg;
msg.body.key_info.type = PMKSA;
msg.body.key_info.action = ADDKEY;
msg.drv = hif_drv;
+ msg.vif = vif;
for (i = 0; i < pu8PmkidInfoArray->numpmkid; i++) {
memcpy(msg.body.key_info.attr.pmkid.pmkidlist[i].bssid,
return result;
}
-s32 wilc_get_mac_address(struct host_if_drv *hif_drv, u8 *pu8MacAddress)
+s32 wilc_get_mac_address(struct wilc_vif *vif, struct host_if_drv *hif_drv,
+ u8 *pu8MacAddress)
{
s32 result = 0;
struct host_if_msg msg;
msg.id = HOST_IF_MSG_GET_MAC_ADDRESS;
msg.body.get_mac_info.mac_addr = pu8MacAddress;
msg.drv = hif_drv;
+ msg.vif = vif;
result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
if (result) {
return result;
}
-s32 wilc_set_mac_address(struct host_if_drv *hif_drv, u8 *pu8MacAddress)
+s32 wilc_set_mac_address(struct wilc_vif *vif, struct host_if_drv *hif_drv,
+ u8 *pu8MacAddress)
{
s32 result = 0;
struct host_if_msg msg;
msg.id = HOST_IF_MSG_SET_MAC_ADDRESS;
memcpy(msg.body.set_mac_info.mac_addr, pu8MacAddress, ETH_ALEN);
msg.drv = hif_drv;
+ msg.vif = vif;
result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
if (result)
return result;
}
-s32 wilc_set_join_req(struct host_if_drv *hif_drv, u8 *pu8bssid,
- const u8 *pu8ssid, size_t ssidLen,
- const u8 *pu8IEs, size_t IEsLen,
- wilc_connect_result pfConnectResult, void *pvUserArg,
- u8 u8security, enum AUTHTYPE tenuAuth_type,
- u8 u8channel, void *pJoinParams)
+s32 wilc_set_join_req(struct wilc_vif *vif, struct host_if_drv *hif_drv,
+ u8 *pu8bssid, const u8 *pu8ssid, size_t ssidLen,
+ const u8 *pu8IEs, size_t IEsLen,
+ wilc_connect_result pfConnectResult, void *pvUserArg,
+ u8 u8security, enum AUTHTYPE tenuAuth_type,
+ u8 u8channel, void *pJoinParams)
{
s32 result = 0;
struct host_if_msg msg;
msg.body.con_info.arg = pvUserArg;
msg.body.con_info.params = pJoinParams;
msg.drv = hif_drv ;
+ msg.vif = vif;
if (pu8bssid) {
msg.body.con_info.bssid = kmalloc(6, GFP_KERNEL);
return result;
}
-s32 wilc_flush_join_req(struct host_if_drv *hif_drv)
+s32 wilc_flush_join_req(struct wilc_vif *vif, struct host_if_drv *hif_drv)
{
s32 result = 0;
struct host_if_msg msg;
msg.id = HOST_IF_MSG_FLUSH_CONNECT;
msg.drv = hif_drv;
+ msg.vif = vif;
result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
if (result) {
return result;
}
-s32 wilc_disconnect(struct host_if_drv *hif_drv, u16 u16ReasonCode)
+s32 wilc_disconnect(struct wilc_vif *vif, struct host_if_drv *hif_drv,
+ u16 u16ReasonCode)
{
s32 result = 0;
struct host_if_msg msg;
msg.id = HOST_IF_MSG_DISCONNECT;
msg.drv = hif_drv;
+ msg.vif = vif;
result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
if (result)
return result;
}
-int wilc_set_mac_chnl_num(struct host_if_drv *hif_drv, u8 channel)
+int wilc_set_mac_chnl_num(struct wilc_vif *vif, struct host_if_drv *hif_drv,
+ u8 channel)
{
int result;
struct host_if_msg msg;
msg.id = HOST_IF_MSG_SET_CHANNEL;
msg.body.channel_info.set_ch = channel;
msg.drv = hif_drv;
+ msg.vif = vif;
result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
if (result) {
return result;
}
-int wilc_set_wfi_drv_handler(struct host_if_drv *hif_drv)
+int wilc_set_wfi_drv_handler(struct wilc_vif *vif, struct host_if_drv *hif_drv)
{
int result = 0;
struct host_if_msg msg;
msg.id = HOST_IF_MSG_SET_WFIDRV_HANDLER;
msg.body.drv.handler = get_id_from_handler(hif_drv);
msg.drv = hif_drv;
+ msg.vif = vif;
result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
if (result) {
return result;
}
-int wilc_set_operation_mode(struct host_if_drv *hif_drv, u32 mode)
+int wilc_set_operation_mode(struct wilc_vif *vif, struct host_if_drv *hif_drv,
+ u32 mode)
{
int result = 0;
struct host_if_msg msg;
msg.id = HOST_IF_MSG_SET_OPERATION_MODE;
msg.body.mode.mode = mode;
msg.drv = hif_drv;
+ msg.vif = vif;
result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
if (result) {
return result;
}
-s32 wilc_get_inactive_time(struct host_if_drv *hif_drv,
+s32 wilc_get_inactive_time(struct wilc_vif *vif, struct host_if_drv *hif_drv,
const u8 *mac, u32 *pu32InactiveTime)
{
s32 result = 0;
msg.id = HOST_IF_MSG_GET_INACTIVETIME;
msg.drv = hif_drv;
+ msg.vif = vif;
result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
if (result)
return result;
}
-s32 wilc_get_rssi(struct host_if_drv *hif_drv, s8 *ps8Rssi)
+s32 wilc_get_rssi(struct wilc_vif *vif, struct host_if_drv *hif_drv,
+ s8 *ps8Rssi)
{
s32 result = 0;
struct host_if_msg msg;
memset(&msg, 0, sizeof(struct host_if_msg));
msg.id = HOST_IF_MSG_GET_RSSI;
msg.drv = hif_drv;
+ msg.vif = vif;
result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
if (result) {
return result;
}
-s32 wilc_get_statistics(struct host_if_drv *hif_drv, struct rf_info *pstrStatistics)
+s32 wilc_get_statistics(struct wilc_vif *vif, struct host_if_drv *hif_drv,
+ struct rf_info *pstrStatistics)
{
s32 result = 0;
struct host_if_msg msg;
msg.id = HOST_IF_MSG_GET_STATISTICS;
msg.body.data = (char *)pstrStatistics;
msg.drv = hif_drv;
+ msg.vif = vif;
result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
if (result) {
return result;
}
-s32 wilc_scan(struct host_if_drv *hif_drv, u8 u8ScanSource,
- u8 u8ScanType, u8 *pu8ChnlFreqList,
- u8 u8ChnlListLen, const u8 *pu8IEs,
- size_t IEsLen, wilc_scan_result ScanResult,
- void *pvUserArg, struct hidden_network *pstrHiddenNetwork)
+s32 wilc_scan(struct wilc_vif *vif, struct host_if_drv *hif_drv,
+ u8 u8ScanSource, u8 u8ScanType, u8 *pu8ChnlFreqList,
+ u8 u8ChnlListLen, const u8 *pu8IEs,
+ size_t IEsLen, wilc_scan_result ScanResult,
+ void *pvUserArg, struct hidden_network *pstrHiddenNetwork)
{
s32 result = 0;
struct host_if_msg msg;
PRINT_D(HOSTINF_DBG, "pstrHiddenNetwork IS EQUAL TO NULL\n");
msg.drv = hif_drv;
+ msg.vif = vif;
msg.body.scan_info.src = u8ScanSource;
msg.body.scan_info.type = u8ScanType;
msg.body.scan_info.result = ScanResult;
return result;
}
-s32 wilc_hif_set_cfg(struct host_if_drv *hif_drv,
+s32 wilc_hif_set_cfg(struct wilc_vif *vif, struct host_if_drv *hif_drv,
struct cfg_param_val *pstrCfgParamVal)
{
s32 result = 0;
msg.id = HOST_IF_MSG_CFG_PARAMS;
msg.body.cfg_info.cfg_attr_info = *pstrCfgParamVal;
msg.drv = hif_drv;
+ msg.vif = vif;
result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
return result;
}
-s32 wilc_deinit(struct host_if_drv *hif_drv)
+s32 wilc_deinit(struct wilc_vif *vif, struct host_if_drv *hif_drv)
{
s32 result = 0;
struct host_if_msg msg;
del_timer_sync(&hif_drv->remain_on_ch_timer);
- wilc_set_wfi_drv_handler(NULL);
+ wilc_set_wfi_drv_handler(vif, NULL);
down(&hif_sema_driver);
if (hif_drv->usr_scan_req.scan_result) {
msg.id = HOST_IF_MSG_EXIT;
msg.drv = hif_drv;
+ msg.vif = vif;
result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
if (result != 0)
return;
}
-s32 wilc_remain_on_channel(struct host_if_drv *hif_drv, u32 u32SessionID,
- u32 u32duration, u16 chan,
- wilc_remain_on_chan_expired RemainOnChanExpired,
- wilc_remain_on_chan_ready RemainOnChanReady,
- void *pvUserArg)
+s32 wilc_remain_on_channel(struct wilc_vif *vif, struct host_if_drv *hif_drv,
+ u32 u32SessionID, u32 u32duration, u16 chan,
+ wilc_remain_on_chan_expired RemainOnChanExpired,
+ wilc_remain_on_chan_ready RemainOnChanReady,
+ void *pvUserArg)
{
s32 result = 0;
struct host_if_msg msg;
msg.body.remain_on_ch.u32duration = u32duration;
msg.body.remain_on_ch.id = u32SessionID;
msg.drv = hif_drv;
+ msg.vif = vif;
result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
if (result)
return result;
}
-s32 wilc_listen_state_expired(struct host_if_drv *hif_drv, u32 u32SessionID)
+s32 wilc_listen_state_expired(struct wilc_vif *vif,
+ struct host_if_drv *hif_drv, u32 u32SessionID)
{
s32 result = 0;
struct host_if_msg msg;
memset(&msg, 0, sizeof(struct host_if_msg));
msg.id = HOST_IF_MSG_LISTEN_TIMER_FIRED;
msg.drv = hif_drv;
+ msg.vif = vif;
msg.body.remain_on_ch.id = u32SessionID;
result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
return result;
}
-s32 wilc_frame_register(struct host_if_drv *hif_drv, u16 u16FrameType, bool bReg)
+s32 wilc_frame_register(struct wilc_vif *vif, struct host_if_drv *hif_drv,
+ u16 u16FrameType, bool bReg)
{
s32 result = 0;
struct host_if_msg msg;
msg.body.reg_frame.frame_type = u16FrameType;
msg.body.reg_frame.reg = bReg;
msg.drv = hif_drv;
+ msg.vif = vif;
result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
if (result)
return result;
}
-s32 wilc_add_beacon(struct host_if_drv *hif_drv, u32 u32Interval,
- u32 u32DTIMPeriod, u32 u32HeadLen, u8 *pu8Head,
- u32 u32TailLen, u8 *pu8Tail)
+s32 wilc_add_beacon(struct wilc_vif *vif, struct host_if_drv *hif_drv,
+ u32 u32Interval,
+ u32 u32DTIMPeriod, u32 u32HeadLen, u8 *pu8Head,
+ u32 u32TailLen, u8 *pu8Tail)
{
s32 result = 0;
struct host_if_msg msg;
msg.id = HOST_IF_MSG_ADD_BEACON;
msg.drv = hif_drv;
+ msg.vif = vif;
pstrSetBeaconParam->interval = u32Interval;
pstrSetBeaconParam->dtim_period = u32DTIMPeriod;
pstrSetBeaconParam->head_len = u32HeadLen;
return result;
}
-int wilc_del_beacon(struct host_if_drv *hif_drv)
+int wilc_del_beacon(struct wilc_vif *vif, struct host_if_drv *hif_drv)
{
int result = 0;
struct host_if_msg msg;
msg.id = HOST_IF_MSG_DEL_BEACON;
msg.drv = hif_drv;
+ msg.vif = vif;
PRINT_D(HOSTINF_DBG, "Setting deleting beacon message queue params\n");
result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
return result;
}
-int wilc_add_station(struct host_if_drv *hif_drv,
+int wilc_add_station(struct wilc_vif *vif, struct host_if_drv *hif_drv,
struct add_sta_param *sta_param)
{
int result = 0;
msg.id = HOST_IF_MSG_ADD_STATION;
msg.drv = hif_drv;
+ msg.vif = vif;
memcpy(add_sta_info, sta_param, sizeof(struct add_sta_param));
if (add_sta_info->rates_len > 0) {
return result;
}
-int wilc_del_station(struct host_if_drv *hif_drv, const u8 *mac_addr)
+int wilc_del_station(struct wilc_vif *vif, struct host_if_drv *hif_drv,
+ const u8 *mac_addr)
{
int result = 0;
struct host_if_msg msg;
msg.id = HOST_IF_MSG_DEL_STATION;
msg.drv = hif_drv;
+ msg.vif = vif;
if (!mac_addr)
eth_broadcast_addr(del_sta_info->mac_addr);
return result;
}
-s32 wilc_del_allstation(struct host_if_drv *hif_drv,
+s32 wilc_del_allstation(struct wilc_vif *vif, struct host_if_drv *hif_drv,
u8 pu8MacAddr[][ETH_ALEN])
{
s32 result = 0;
msg.id = HOST_IF_MSG_DEL_ALL_STA;
msg.drv = hif_drv;
+ msg.vif = vif;
for (i = 0; i < MAX_NUM_STA; i++) {
if (memcmp(pu8MacAddr[i], au8Zero_Buff, ETH_ALEN)) {
return result;
}
-s32 wilc_edit_station(struct host_if_drv *hif_drv,
+s32 wilc_edit_station(struct wilc_vif *vif, struct host_if_drv *hif_drv,
struct add_sta_param *pstrStaParams)
{
s32 result = 0;
msg.id = HOST_IF_MSG_EDIT_STATION;
msg.drv = hif_drv;
+ msg.vif = vif;
memcpy(pstrAddStationMsg, pstrStaParams, sizeof(struct add_sta_param));
if (pstrAddStationMsg->rates_len > 0) {
return result;
}
-s32 wilc_set_power_mgmt(struct host_if_drv *hif_drv,
- bool bIsEnabled,
- u32 u32Timeout)
+s32 wilc_set_power_mgmt(struct wilc_vif *vif, struct host_if_drv *hif_drv,
+ bool bIsEnabled, u32 u32Timeout)
{
s32 result = 0;
struct host_if_msg msg;
msg.id = HOST_IF_MSG_POWER_MGMT;
msg.drv = hif_drv;
+ msg.vif = vif;
pstrPowerMgmtParam->enabled = bIsEnabled;
pstrPowerMgmtParam->timeout = u32Timeout;
return result;
}
-s32 wilc_setup_multicast_filter(struct host_if_drv *hif_drv,
- bool bIsEnabled,
- u32 u32count)
+s32 wilc_setup_multicast_filter(struct wilc_vif *vif,
+ struct host_if_drv *hif_drv,
+ bool bIsEnabled,
+ u32 u32count)
{
s32 result = 0;
struct host_if_msg msg;
msg.id = HOST_IF_MSG_SET_MULTICAST_FILTER;
msg.drv = hif_drv;
+ msg.vif = vif;
pstrMulticastFilterParam->enabled = bIsEnabled;
pstrMulticastFilterParam->cnt = u32count;
PRINT_ER("Unable to FREE null pointer\n");
}
-s32 wilc_del_all_rx_ba_session(struct host_if_drv *hif_drv,
- char *pBSSID,
- char TID)
+s32 wilc_del_all_rx_ba_session(struct wilc_vif *vif,
+ struct host_if_drv *hif_drv,
+ char *pBSSID,
+ char TID)
{
s32 result = 0;
struct host_if_msg msg;
memcpy(pBASessionInfo->bssid, pBSSID, ETH_ALEN);
pBASessionInfo->tid = TID;
msg.drv = hif_drv;
+ msg.vif = vif;
result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
if (result)
return result;
}
-s32 wilc_setup_ipaddress(struct host_if_drv *hif_drv, u8 *u16ipadd, u8 idx)
+s32 wilc_setup_ipaddress(struct wilc_vif *vif, struct host_if_drv *hif_drv,
+ u8 *u16ipadd, u8 idx)
{
s32 result = 0;
struct host_if_msg msg;
msg.body.ip_info.ip_addr = u16ipadd;
msg.drv = hif_drv;
+ msg.vif = vif;
msg.body.ip_info.idx = idx;
result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
return result;
}
-static s32 host_int_get_ipaddress(struct host_if_drv *hif_drv, u8 *u16ipadd, u8 idx)
+static s32 host_int_get_ipaddress(struct wilc_vif *vif,
+ struct host_if_drv *hif_drv,
+ u8 *u16ipadd, u8 idx)
{
s32 result = 0;
struct host_if_msg msg;
msg.body.ip_info.ip_addr = u16ipadd;
msg.drv = hif_drv;
+ msg.vif = vif;
msg.body.ip_info.idx = idx;
result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
u16 flags_set;
};
+struct wilc_vif;
s32 wilc_remove_key(struct host_if_drv *hWFIDrv, const u8 *pu8StaAddress);
-int wilc_remove_wep_key(struct host_if_drv *wfi_drv, u8 index);
-int wilc_set_wep_default_keyid(struct host_if_drv *hif_drv, u8 index);
-int wilc_add_wep_key_bss_sta(struct host_if_drv *hif_drv,
- const u8 *key, u8 len, u8 index);
-int wilc_add_wep_key_bss_ap(struct host_if_drv *hif_drv,
- const u8 *key, u8 len, u8 index, u8 mode,
- enum AUTHTYPE auth_type);
-s32 wilc_add_ptk(struct host_if_drv *hWFIDrv, const u8 *pu8Ptk,
- u8 u8PtkKeylen, const u8 *mac_addr,
- const u8 *pu8RxMic, const u8 *pu8TxMic,
- u8 mode, u8 u8Ciphermode, u8 u8Idx);
-s32 wilc_get_inactive_time(struct host_if_drv *hWFIDrv, const u8 *mac,
- u32 *pu32InactiveTime);
-s32 wilc_add_rx_gtk(struct host_if_drv *hWFIDrv, const u8 *pu8RxGtk,
- u8 u8GtkKeylen, u8 u8KeyIdx,
- u32 u32KeyRSClen, const u8 *KeyRSC,
- const u8 *pu8RxMic, const u8 *pu8TxMic,
- u8 mode, u8 u8Ciphermode);
+int wilc_remove_wep_key(struct wilc_vif *vif,
+ struct host_if_drv *hif_drv, u8 index);
+int wilc_set_wep_default_keyid(struct wilc_vif *vif,
+ struct host_if_drv *hif_drv, u8 index);
+int wilc_add_wep_key_bss_sta(struct wilc_vif *vif, struct host_if_drv *hif_drv,
+ const u8 *key, u8 len, u8 index);
+int wilc_add_wep_key_bss_ap(struct wilc_vif *vif, struct host_if_drv *hif_drv,
+ const u8 *key, u8 len, u8 index, u8 mode,
+ enum AUTHTYPE auth_type);
+s32 wilc_add_ptk(struct wilc_vif *vif, struct host_if_drv *hif_drv,
+ const u8 *pu8Ptk, u8 u8PtkKeylen, const u8 *mac_addr,
+ const u8 *pu8RxMic, const u8 *pu8TxMic,
+ u8 mode, u8 u8Ciphermode, u8 u8Idx);
+s32 wilc_get_inactive_time(struct wilc_vif *vif, struct host_if_drv *hif_drv,
+ const u8 *mac, u32 *pu32InactiveTime);
+s32 wilc_add_rx_gtk(struct wilc_vif *vif, struct host_if_drv *hif_drv,
+ const u8 *pu8RxGtk, u8 u8GtkKeylen, u8 u8KeyIdx,
+ u32 u32KeyRSClen, const u8 *KeyRSC,
+ const u8 *pu8RxMic, const u8 *pu8TxMic,
+ u8 mode, u8 u8Ciphermode);
s32 wilc_add_tx_gtk(struct host_if_drv *hWFIDrv, u8 u8KeyLen,
u8 *pu8TxGtk, u8 u8KeyIdx);
-s32 wilc_set_pmkid_info(struct host_if_drv *hWFIDrv,
- struct host_if_pmkid_attr *pu8PmkidInfoArray);
-s32 wilc_get_mac_address(struct host_if_drv *hWFIDrv, u8 *pu8MacAddress);
-s32 wilc_set_mac_address(struct host_if_drv *hWFIDrv, u8 *pu8MacAddress);
+s32 wilc_set_pmkid_info(struct wilc_vif *vif, struct host_if_drv *hif_drv,
+ struct host_if_pmkid_attr *pu8PmkidInfoArray);
+s32 wilc_get_mac_address(struct wilc_vif *vif, struct host_if_drv *hif_drv,
+ u8 *pu8MacAddress);
+s32 wilc_set_mac_address(struct wilc_vif *vif, struct host_if_drv *hif_drv,
+ u8 *pu8MacAddress);
int wilc_wait_msg_queue_idle(void);
s32 wilc_set_start_scan_req(struct host_if_drv *hWFIDrv, u8 scanSource);
-s32 wilc_set_join_req(struct host_if_drv *hWFIDrv, u8 *pu8bssid,
- const u8 *pu8ssid, size_t ssidLen,
- const u8 *pu8IEs, size_t IEsLen,
- wilc_connect_result pfConnectResult, void *pvUserArg,
- u8 u8security, enum AUTHTYPE tenuAuth_type,
- u8 u8channel, void *pJoinParams);
-s32 wilc_flush_join_req(struct host_if_drv *hWFIDrv);
-s32 wilc_disconnect(struct host_if_drv *hWFIDrv, u16 u16ReasonCode);
-int wilc_set_mac_chnl_num(struct host_if_drv *wfi_drv, u8 channel);
-s32 wilc_get_rssi(struct host_if_drv *hWFIDrv, s8 *ps8Rssi);
-s32 wilc_scan(struct host_if_drv *hWFIDrv, u8 u8ScanSource,
- u8 u8ScanType, u8 *pu8ChnlFreqList,
- u8 u8ChnlListLen, const u8 *pu8IEs,
- size_t IEsLen, wilc_scan_result ScanResult,
- void *pvUserArg, struct hidden_network *pstrHiddenNetwork);
-s32 wilc_hif_set_cfg(struct host_if_drv *hWFIDrv,
+s32 wilc_set_join_req(struct wilc_vif *vif, struct host_if_drv *hif_drv,
+ u8 *pu8bssid, const u8 *pu8ssid, size_t ssidLen,
+ const u8 *pu8IEs, size_t IEsLen,
+ wilc_connect_result pfConnectResult, void *pvUserArg,
+ u8 u8security, enum AUTHTYPE tenuAuth_type,
+ u8 u8channel, void *pJoinParams);
+s32 wilc_flush_join_req(struct wilc_vif *vif, struct host_if_drv *hif_drv);
+s32 wilc_disconnect(struct wilc_vif *vif, struct host_if_drv *hif_drv,
+ u16 u16ReasonCode);
+int wilc_set_mac_chnl_num(struct wilc_vif *vif, struct host_if_drv *hif_drv,
+ u8 channel);
+s32 wilc_get_rssi(struct wilc_vif *vif, struct host_if_drv *hif_drv,
+ s8 *ps8Rssi);
+s32 wilc_scan(struct wilc_vif *vif, struct host_if_drv *hif_drv,
+ u8 u8ScanSource, u8 u8ScanType, u8 *pu8ChnlFreqList,
+ u8 u8ChnlListLen, const u8 *pu8IEs,
+ size_t IEsLen, wilc_scan_result ScanResult,
+ void *pvUserArg, struct hidden_network *pstrHiddenNetwork);
+s32 wilc_hif_set_cfg(struct wilc_vif *vif, struct host_if_drv *hif_drv,
struct cfg_param_val *pstrCfgParamVal);
s32 wilc_init(struct net_device *dev, struct host_if_drv **phWFIDrv);
-s32 wilc_deinit(struct host_if_drv *hWFIDrv);
-s32 wilc_add_beacon(struct host_if_drv *hWFIDrv, u32 u32Interval,
- u32 u32DTIMPeriod,
- u32 u32HeadLen,
- u8 *pu8Head,
- u32 u32TailLen,
- u8 *pu8tail);
-int wilc_del_beacon(struct host_if_drv *hif_drv);
-int wilc_add_station(struct host_if_drv *hif_drv,
- struct add_sta_param *sta_param);
-s32 wilc_del_allstation(struct host_if_drv *hWFIDrv,
+s32 wilc_deinit(struct wilc_vif *vif, struct host_if_drv *hif_drv);
+s32 wilc_add_beacon(struct wilc_vif *vif, struct host_if_drv *hif_drv,
+ u32 u32Interval,
+ u32 u32DTIMPeriod, u32 u32HeadLen, u8 *pu8Head,
+ u32 u32TailLen, u8 *pu8Tail);
+int wilc_del_beacon(struct wilc_vif *vif, struct host_if_drv *hif_drv);
+int wilc_add_station(struct wilc_vif *vif, struct host_if_drv *hif_drv,
+ struct add_sta_param *sta_param);
+s32 wilc_del_allstation(struct wilc_vif *vif, struct host_if_drv *hif_drv,
u8 pu8MacAddr[][ETH_ALEN]);
-int wilc_del_station(struct host_if_drv *hif_drv, const u8 *mac_addr);
-s32 wilc_edit_station(struct host_if_drv *hWFIDrv,
+int wilc_del_station(struct wilc_vif *vif, struct host_if_drv *hif_drv,
+ const u8 *mac_addr);
+s32 wilc_edit_station(struct wilc_vif *vif, struct host_if_drv *hif_drv,
struct add_sta_param *pstrStaParams);
-s32 wilc_set_power_mgmt(struct host_if_drv *hWFIDrv,
- bool bIsEnabled,
- u32 u32Timeout);
-s32 wilc_setup_multicast_filter(struct host_if_drv *hWFIDrv,
- bool bIsEnabled,
- u32 u32count);
-s32 wilc_setup_ipaddress(struct host_if_drv *hWFIDrv,
- u8 *pu8IPAddr,
- u8 idx);
-s32 wilc_del_all_rx_ba_session(struct host_if_drv *hWFIDrv,
- char *pBSSID,
- char TID);
-s32 wilc_remain_on_channel(struct host_if_drv *hWFIDrv,
- u32 u32SessionID,
- u32 u32duration,
- u16 chan,
- wilc_remain_on_chan_expired RemainOnChanExpired,
- wilc_remain_on_chan_ready RemainOnChanReady,
- void *pvUserArg);
-s32 wilc_listen_state_expired(struct host_if_drv *hWFIDrv, u32 u32SessionID);
-s32 wilc_frame_register(struct host_if_drv *hWFIDrv,
- u16 u16FrameType,
- bool bReg);
-int wilc_set_wfi_drv_handler(struct host_if_drv *address);
-int wilc_set_operation_mode(struct host_if_drv *wfi_drv, u32 mode);
+s32 wilc_set_power_mgmt(struct wilc_vif *vif, struct host_if_drv *hif_drv,
+ bool bIsEnabled, u32 u32Timeout);
+s32 wilc_setup_multicast_filter(struct wilc_vif *vif,
+ struct host_if_drv *hif_drv,
+ bool bIsEnabled,
+ u32 u32count);
+s32 wilc_setup_ipaddress(struct wilc_vif *vif, struct host_if_drv *hif_drv,
+ u8 *u16ipadd, u8 idx);
+s32 wilc_del_all_rx_ba_session(struct wilc_vif *vif,
+ struct host_if_drv *hif_drv,
+ char *pBSSID,
+ char TID);
+s32 wilc_remain_on_channel(struct wilc_vif *vif, struct host_if_drv *hif_drv,
+ u32 u32SessionID, u32 u32duration, u16 chan,
+ wilc_remain_on_chan_expired RemainOnChanExpired,
+ wilc_remain_on_chan_ready RemainOnChanReady,
+ void *pvUserArg);
+s32 wilc_listen_state_expired(struct wilc_vif *vif,
+ struct host_if_drv *hif_drv, u32 u32SessionID);
+s32 wilc_frame_register(struct wilc_vif *vif, struct host_if_drv *hif_drv,
+ u16 u16FrameType, bool bReg);
+int wilc_set_wfi_drv_handler(struct wilc_vif *vif, struct host_if_drv *hif_drv);
+int wilc_set_operation_mode(struct wilc_vif *vif, struct host_if_drv *hif_drv,
+ u32 mode);
void wilc_free_join_params(void *pJoinParams);
-s32 wilc_get_statistics(struct host_if_drv *hWFIDrv,
- struct rf_info *pstrStatistics);
-void wilc_resolve_disconnect_aberration(struct host_if_drv *hif_drv);
+s32 wilc_get_statistics(struct wilc_vif *vif, struct host_if_drv *hif_drv,
+ struct rf_info *pstrStatistics);
+void wilc_resolve_disconnect_aberration(struct wilc_vif *vif,
+ struct host_if_drv *hif_drv);
extern bool wilc_optaining_ip;
extern u8 wilc_connected_ssid[6];
}
if (wilc_enable_ps)
- wilc_set_power_mgmt(hif_drv, 1, 0);
+ wilc_set_power_mgmt(vif, hif_drv, 1, 0);
PRINT_D(GENERIC_DBG, "[%s] Up IP\n", dev_iface->ifa_label);
PRINT_D(GENERIC_DBG, "IP add=%d:%d:%d:%d\n",
ip_addr_buf[0], ip_addr_buf[1],
ip_addr_buf[2], ip_addr_buf[3]);
- wilc_setup_ipaddress(hif_drv, ip_addr_buf, vif->u8IfIdx);
+ wilc_setup_ipaddress(vif, hif_drv, ip_addr_buf, vif->u8IfIdx);
break;
}
if (memcmp(dev_iface->ifa_label, wlan_dev_name, 5) == 0)
- wilc_set_power_mgmt(hif_drv, 0, 0);
+ wilc_set_power_mgmt(vif, hif_drv, 0, 0);
- wilc_resolve_disconnect_aberration(hif_drv);
+ wilc_resolve_disconnect_aberration(vif, hif_drv);
PRINT_D(GENERIC_DBG, "[%s] Down IP\n", dev_iface->ifa_label);
ip_addr_buf[0], ip_addr_buf[1],
ip_addr_buf[2], ip_addr_buf[3]);
- wilc_setup_ipaddress(hif_drv, ip_addr_buf, vif->u8IfIdx);
+ wilc_setup_ipaddress(vif, hif_drv, ip_addr_buf, vif->u8IfIdx);
break;
wilc_set_machw_change_vir_if(ndev, false);
- wilc_get_mac_address(priv->hWILCWFIDrv, mac_add);
+ wilc_get_mac_address(vif, priv->hWILCWFIDrv, mac_add);
PRINT_D(INIT_DBG, "Mac address: %pM\n", mac_add);
for (i = 0; i < wl->vif_num; i++) {
struct netdev_hw_addr *ha;
struct wilc_priv *priv;
struct host_if_drv *hif_drv;
+ struct wilc_vif *vif;
int i = 0;
priv = wiphy_priv(dev->ieee80211_ptr->wiphy);
+ vif = netdev_priv(dev);
hif_drv = (struct host_if_drv *)priv->hWILCWFIDrv;
if (!dev)
if ((dev->flags & IFF_ALLMULTI) ||
(dev->mc.count) > WILC_MULTICAST_TABLE_SIZE) {
PRINT_D(INIT_DBG, "Disable multicast filter, retrive all multicast packets\n");
- wilc_setup_multicast_filter(hif_drv, false, 0);
+ wilc_setup_multicast_filter(vif, hif_drv, false, 0);
return;
}
if ((dev->mc.count) == 0) {
PRINT_D(INIT_DBG, "Enable multicast filter, retrive directed packets only.\n");
- wilc_setup_multicast_filter(hif_drv, true, 0);
+ wilc_setup_multicast_filter(vif, hif_drv, true, 0);
return;
}
i++;
}
- wilc_setup_multicast_filter(hif_drv, true, (dev->mc.count));
+ wilc_setup_multicast_filter(vif, hif_drv, true, (dev->mc.count));
return;
}
if (strncasecmp(buff, "RSSI", length) == 0) {
priv = wiphy_priv(vif->ndev->ieee80211_ptr->wiphy);
- ret = wilc_get_rssi(priv->hWILCWFIDrv, &rssi);
+ ret = wilc_get_rssi(vif, priv->hWILCWFIDrv, &rssi);
if (ret)
PRINT_ER("Failed to send get rssi param's message queue ");
PRINT_INFO(GENERIC_DBG, "RSSI :%d\n", rssi);
u32 channelnum = 0;
struct wilc_priv *priv;
int result = 0;
+ struct wilc_vif *vif;
priv = wiphy_priv(wiphy);
+ vif = netdev_priv(priv->dev);
channelnum = ieee80211_frequency_to_channel(chandef->chan->center_freq);
PRINT_D(CFG80211_DBG, "Setting channel %d with frequency %d\n", channelnum, chandef->chan->center_freq);
curr_channel = channelnum;
- result = wilc_set_mac_chnl_num(priv->hWILCWFIDrv, channelnum);
+ result = wilc_set_mac_chnl_num(vif, priv->hWILCWFIDrv, channelnum);
if (result != 0)
PRINT_ER("Error in setting channel %d\n", channelnum);
s32 s32Error = 0;
u8 au8ScanChanList[MAX_NUM_SCANNED_NETWORKS];
struct hidden_network strHiddenNetwork;
+ struct wilc_vif *vif;
priv = wiphy_priv(wiphy);
+ vif = netdev_priv(priv->dev);
priv->pstrScanReq = request;
priv->u32RcvdChCount = 0;
- wilc_set_wfi_drv_handler(priv->hWILCWFIDrv);
+ wilc_set_wfi_drv_handler(vif, priv->hWILCWFIDrv);
reset_shadow_found();
priv->bCfgScanning = true;
}
}
PRINT_D(CFG80211_DBG, "Trigger Scan Request\n");
- s32Error = wilc_scan(priv->hWILCWFIDrv, USER_SCAN, ACTIVE_SCAN,
+ s32Error = wilc_scan(vif, priv->hWILCWFIDrv, USER_SCAN, ACTIVE_SCAN,
au8ScanChanList, request->n_channels,
(const u8 *)request->ie, request->ie_len,
CfgScanResult, (void *)priv, &strHiddenNetwork);
} else {
PRINT_D(CFG80211_DBG, "Trigger Scan Request\n");
- s32Error = wilc_scan(priv->hWILCWFIDrv, USER_SCAN, ACTIVE_SCAN,
+ s32Error = wilc_scan(vif, priv->hWILCWFIDrv, USER_SCAN, ACTIVE_SCAN,
au8ScanChanList, request->n_channels,
(const u8 *)request->ie, request->ie_len,
CfgScanResult, (void *)priv, NULL);
struct wilc_priv *priv;
struct host_if_drv *pstrWFIDrv;
tstrNetworkInfo *pstrNetworkInfo = NULL;
-
+ struct wilc_vif *vif;
wilc_connecting = 1;
priv = wiphy_priv(wiphy);
+ vif = netdev_priv(priv->dev);
pstrWFIDrv = (struct host_if_drv *)(priv->hWILCWFIDrv);
- wilc_set_wfi_drv_handler(priv->hWILCWFIDrv);
+ wilc_set_wfi_drv_handler(vif, priv->hWILCWFIDrv);
PRINT_D(CFG80211_DBG, "Connecting to SSID [%s] on netdev [%p] host if [%p]\n", sme->ssid, dev, priv->hWILCWFIDrv);
if (!(strncmp(sme->ssid, "DIRECT-", 7))) {
g_key_wep_params.key_idx = sme->key_idx;
g_wep_keys_saved = true;
- wilc_set_wep_default_keyid(priv->hWILCWFIDrv, sme->key_idx);
- wilc_add_wep_key_bss_sta(priv->hWILCWFIDrv, sme->key, sme->key_len, sme->key_idx);
+ wilc_set_wep_default_keyid(vif, priv->hWILCWFIDrv, sme->key_idx);
+ wilc_add_wep_key_bss_sta(vif, priv->hWILCWFIDrv, sme->key, sme->key_len, sme->key_idx);
} else if (sme->crypto.cipher_group == WLAN_CIPHER_SUITE_WEP104) {
u8security = ENCRYPT_ENABLED | WEP | WEP_EXTENDED;
pcgroup_encrypt_val = "WEP104";
g_key_wep_params.key_idx = sme->key_idx;
g_wep_keys_saved = true;
- wilc_set_wep_default_keyid(priv->hWILCWFIDrv, sme->key_idx);
- wilc_add_wep_key_bss_sta(priv->hWILCWFIDrv, sme->key, sme->key_len, sme->key_idx);
+ wilc_set_wep_default_keyid(vif, priv->hWILCWFIDrv, sme->key_idx);
+ wilc_add_wep_key_bss_sta(vif, priv->hWILCWFIDrv, sme->key, sme->key_len, sme->key_idx);
} else if (sme->crypto.wpa_versions & NL80211_WPA_VERSION_2) {
if (sme->crypto.cipher_group == WLAN_CIPHER_SUITE_TKIP) {
u8security = ENCRYPT_ENABLED | WPA2 | TKIP;
wilc_wlan_set_bssid(dev, pstrNetworkInfo->au8bssid);
- s32Error = wilc_set_join_req(priv->hWILCWFIDrv, pstrNetworkInfo->au8bssid, sme->ssid,
+ s32Error = wilc_set_join_req(vif, priv->hWILCWFIDrv, pstrNetworkInfo->au8bssid, sme->ssid,
sme->ssid_len, sme->ie, sme->ie_len,
CfgConnectResult, (void *)priv, u8security,
tenuAuth_type, pstrNetworkInfo->u8channel,
s32 s32Error = 0;
struct wilc_priv *priv;
struct host_if_drv *pstrWFIDrv;
+ struct wilc_vif *vif;
u8 NullBssid[ETH_ALEN] = {0};
wilc_connecting = 0;
priv = wiphy_priv(wiphy);
+ vif = netdev_priv(priv->dev);
pstrWFIDrv = (struct host_if_drv *)priv->hWILCWFIDrv;
if (!pstrWFIDrv->p2p_connect)
wilc_ie = false;
pstrWFIDrv->p2p_timeout = 0;
- s32Error = wilc_disconnect(priv->hWILCWFIDrv, reason_code);
+ s32Error = wilc_disconnect(vif, priv->hWILCWFIDrv, reason_code);
if (s32Error != 0) {
PRINT_ER("Error in disconnecting: Error(%d)\n", s32Error);
s32Error = -EINVAL;
else
u8mode = ENCRYPT_ENABLED | WEP | WEP_EXTENDED;
- wilc_add_wep_key_bss_ap(priv->hWILCWFIDrv, params->key, params->key_len, key_index, u8mode, tenuAuth_type);
+ wilc_add_wep_key_bss_ap(vif, priv->hWILCWFIDrv, params->key, params->key_len, key_index, u8mode, tenuAuth_type);
break;
}
if (memcmp(params->key, priv->WILC_WFI_wep_key[key_index], params->key_len)) {
for (i = 0; i < params->key_len; i++)
PRINT_INFO(CFG80211_DBG, "WEP key value[%d] = %d\n", i, params->key[i]);
}
- wilc_add_wep_key_bss_sta(priv->hWILCWFIDrv, params->key, params->key_len, key_index);
+ wilc_add_wep_key_bss_sta(vif, priv->hWILCWFIDrv, params->key, params->key_len, key_index);
}
break;
}
- wilc_add_rx_gtk(priv->hWILCWFIDrv, params->key, KeyLen,
+ wilc_add_rx_gtk(vif, priv->hWILCWFIDrv, params->key, KeyLen,
key_index, params->seq_len, params->seq, pu8RxMic, pu8TxMic, AP_MODE, u8gmode);
} else {
priv->wilc_ptk[key_index]->key_len = params->key_len;
priv->wilc_ptk[key_index]->seq_len = params->seq_len;
- wilc_add_ptk(priv->hWILCWFIDrv, params->key, KeyLen, mac_addr,
+ wilc_add_ptk(vif, priv->hWILCWFIDrv, params->key, KeyLen, mac_addr,
pu8RxMic, pu8TxMic, AP_MODE, u8pmode, key_index);
}
break;
g_gtk_keys_saved = true;
}
- wilc_add_rx_gtk(priv->hWILCWFIDrv, params->key, KeyLen,
+ wilc_add_rx_gtk(vif, priv->hWILCWFIDrv, params->key, KeyLen,
key_index, params->seq_len, params->seq, pu8RxMic, pu8TxMic, STATION_MODE, u8mode);
} else {
if (params->key_len > 16 && params->cipher == WLAN_CIPHER_SUITE_TKIP) {
g_ptk_keys_saved = true;
}
- wilc_add_ptk(priv->hWILCWFIDrv, params->key, KeyLen, mac_addr,
+ wilc_add_ptk(vif, priv->hWILCWFIDrv, params->key, KeyLen, mac_addr,
pu8RxMic, pu8TxMic, STATION_MODE, u8mode, key_index);
PRINT_D(CFG80211_DBG, "Adding pairwise key\n");
if (INFO) {
priv->WILC_WFI_wep_key_len[key_index] = 0;
PRINT_D(CFG80211_DBG, "Removing WEP key with index = %d\n", key_index);
- wilc_remove_wep_key(priv->hWILCWFIDrv, key_index);
+ wilc_remove_wep_key(vif, priv->hWILCWFIDrv, key_index);
} else {
PRINT_D(CFG80211_DBG, "Removing all installed keys\n");
wilc_remove_key(priv->hWILCWFIDrv, mac_addr);
bool unicast, bool multicast)
{
struct wilc_priv *priv;
-
+ struct wilc_vif *vif;
priv = wiphy_priv(wiphy);
+ vif = netdev_priv(priv->dev);
PRINT_D(CFG80211_DBG, "Setting default key with idx = %d\n", key_index);
if (key_index != priv->WILC_WFI_wep_default) {
- wilc_set_wep_default_keyid(priv->hWILCWFIDrv, key_index);
+ wilc_set_wep_default_keyid(vif, priv->hWILCWFIDrv, key_index);
}
return 0;
sinfo->filled |= BIT(NL80211_STA_INFO_INACTIVE_TIME);
- wilc_get_inactive_time(priv->hWILCWFIDrv, mac, &(inactive_time));
+ wilc_get_inactive_time(vif, priv->hWILCWFIDrv, mac, &(inactive_time));
sinfo->inactive_time = 1000 * inactive_time;
PRINT_D(CFG80211_DBG, "Inactive time %d\n", sinfo->inactive_time);
}
if (vif->iftype == STATION_MODE) {
struct rf_info strStatistics;
- wilc_get_statistics(priv->hWILCWFIDrv, &strStatistics);
+ wilc_get_statistics(vif, priv->hWILCWFIDrv, &strStatistics);
sinfo->filled |= BIT(NL80211_STA_INFO_SIGNAL) |
BIT(NL80211_STA_INFO_RX_PACKETS) |
s32 s32Error = 0;
struct cfg_param_val pstrCfgParamVal;
struct wilc_priv *priv;
+ struct wilc_vif *vif;
priv = wiphy_priv(wiphy);
+ vif = netdev_priv(priv->dev);
pstrCfgParamVal.flag = 0;
PRINT_D(CFG80211_DBG, "Setting Wiphy params\n");
}
PRINT_D(CFG80211_DBG, "Setting CFG params in the host interface\n");
- s32Error = wilc_hif_set_cfg(priv->hWILCWFIDrv, &pstrCfgParamVal);
+ s32Error = wilc_hif_set_cfg(vif, priv->hWILCWFIDrv, &pstrCfgParamVal);
if (s32Error)
PRINT_ER("Error in setting WIPHY PARAMS\n");
u32 i;
s32 s32Error = 0;
u8 flag = 0;
-
+ struct wilc_vif *vif;
struct wilc_priv *priv = wiphy_priv(wiphy);
+ vif = netdev_priv(priv->dev);
PRINT_D(CFG80211_DBG, "Setting PMKSA\n");
if (!s32Error) {
PRINT_D(CFG80211_DBG, "Setting pmkid in the host interface\n");
- s32Error = wilc_set_pmkid_info(priv->hWILCWFIDrv, &priv->pmkid_list);
+ s32Error = wilc_set_pmkid_info(vif, priv->hWILCWFIDrv, &priv->pmkid_list);
}
return s32Error;
}
{
s32 s32Error = 0;
struct wilc_priv *priv;
+ struct wilc_vif *vif;
priv = wiphy_priv(wiphy);
+ vif = netdev_priv(priv->dev);
PRINT_D(GENERIC_DBG, "Remaining on channel %d\n", chan->hw_value);
priv->strRemainOnChanParams.u32ListenDuration = duration;
priv->strRemainOnChanParams.u32ListenSessionID++;
- s32Error = wilc_remain_on_channel(priv->hWILCWFIDrv
+ s32Error = wilc_remain_on_channel(vif, priv->hWILCWFIDrv
, priv->strRemainOnChanParams.u32ListenSessionID
, duration
, chan->hw_value
{
s32 s32Error = 0;
struct wilc_priv *priv;
+ struct wilc_vif *vif;
priv = wiphy_priv(wiphy);
+ vif = netdev_priv(priv->dev);
PRINT_D(CFG80211_DBG, "Cancel remain on channel\n");
- s32Error = wilc_listen_state_expired(priv->hWILCWFIDrv, priv->strRemainOnChanParams.u32ListenSessionID);
+ s32Error = wilc_listen_state_expired(vif, priv->hWILCWFIDrv, priv->strRemainOnChanParams.u32ListenSessionID);
return s32Error;
}
if (ieee80211_is_probe_resp(mgmt->frame_control)) {
PRINT_D(GENERIC_DBG, "TX: Probe Response\n");
PRINT_D(GENERIC_DBG, "Setting channel: %d\n", chan->hw_value);
- wilc_set_mac_chnl_num(priv->hWILCWFIDrv, chan->hw_value);
+ wilc_set_mac_chnl_num(vif, priv->hWILCWFIDrv, chan->hw_value);
curr_channel = chan->hw_value;
} else if (ieee80211_is_action(mgmt->frame_control)) {
PRINT_D(GENERIC_DBG, "ACTION FRAME:%x\n", (u16)mgmt->frame_control);
if (buf[ACTION_SUBTYPE_ID] != PUBLIC_ACT_VENDORSPEC ||
buf[P2P_PUB_ACTION_SUBTYPE] != GO_NEG_CONF) {
PRINT_D(GENERIC_DBG, "Setting channel: %d\n", chan->hw_value);
- wilc_set_mac_chnl_num(priv->hWILCWFIDrv, chan->hw_value);
+ wilc_set_mac_chnl_num(vif, priv->hWILCWFIDrv, chan->hw_value);
curr_channel = chan->hw_value;
}
switch (buf[ACTION_SUBTYPE_ID]) {
PRINT_D(GENERIC_DBG, "Return since mac is closed\n");
return;
}
- wilc_frame_register(priv->hWILCWFIDrv, frame_type, reg);
+ wilc_frame_register(vif, priv->hWILCWFIDrv, frame_type, reg);
}
static int set_cqm_rssi_config(struct wiphy *wiphy, struct net_device *dev,
int idx, u8 *mac, struct station_info *sinfo)
{
struct wilc_priv *priv;
+ struct wilc_vif *vif;
PRINT_D(CFG80211_DBG, "Dumping station information\n");
return -ENOENT;
priv = wiphy_priv(wiphy);
+ vif = netdev_priv(priv->dev);
sinfo->filled |= BIT(NL80211_STA_INFO_SIGNAL);
- wilc_get_rssi(priv->hWILCWFIDrv, &(sinfo->signal));
+ wilc_get_rssi(vif, priv->hWILCWFIDrv, &(sinfo->signal));
return 0;
}
bool enabled, int timeout)
{
struct wilc_priv *priv;
+ struct wilc_vif *vif;
PRINT_D(CFG80211_DBG, " Power save Enabled= %d , TimeOut = %d\n", enabled, timeout);
return -ENOENT;
priv = wiphy_priv(wiphy);
+ vif = netdev_priv(priv->dev);
if (!priv->hWILCWFIDrv) {
PRINT_ER("Driver is NULL\n");
return -EIO;
}
if (wilc_enable_ps)
- wilc_set_power_mgmt(priv->hWILCWFIDrv, enabled, timeout);
+ wilc_set_power_mgmt(vif, priv->hWILCWFIDrv, enabled, timeout);
return 0;
vif->iftype = STATION_MODE;
if (wl->initialized) {
- wilc_del_all_rx_ba_session(priv->hWILCWFIDrv,
+ wilc_del_all_rx_ba_session(vif, priv->hWILCWFIDrv,
wl->vif[0]->bssid, TID);
wilc_wait_msg_queue_idle();
wilc_initialized = 1;
vif->iftype = interface_type;
- wilc_set_wfi_drv_handler(wl->vif[0]->hif_drv);
- wilc_set_mac_address(wl->vif[0]->hif_drv,
+ wilc_set_wfi_drv_handler(vif, wl->vif[0]->hif_drv);
+ wilc_set_mac_address(vif, wl->vif[0]->hif_drv,
wl->vif[0]->src_addr);
- wilc_set_operation_mode(priv->hWILCWFIDrv, STATION_MODE);
+ wilc_set_operation_mode(vif, priv->hWILCWFIDrv, STATION_MODE);
if (g_wep_keys_saved) {
- wilc_set_wep_default_keyid(wl->vif[0]->hif_drv,
+ wilc_set_wep_default_keyid(vif, wl->vif[0]->hif_drv,
g_key_wep_params.key_idx);
- wilc_add_wep_key_bss_sta(wl->vif[0]->hif_drv,
+ wilc_add_wep_key_bss_sta(vif, wl->vif[0]->hif_drv,
g_key_wep_params.key,
g_key_wep_params.key_len,
g_key_wep_params.key_idx);
}
- wilc_flush_join_req(priv->hWILCWFIDrv);
+ wilc_flush_join_req(vif, priv->hWILCWFIDrv);
if (g_ptk_keys_saved && g_gtk_keys_saved) {
PRINT_D(CFG80211_DBG, "ptk %x %x %x\n", g_key_ptk_params.key[0],
for (i = 0; i < num_reg_frame; i++) {
PRINT_D(INIT_DBG, "Frame registering Type: %x - Reg: %d\n", vif->g_struct_frame_reg[i].frame_type,
vif->g_struct_frame_reg[i].reg);
- wilc_frame_register(priv->hWILCWFIDrv,
+ wilc_frame_register(vif, priv->hWILCWFIDrv,
vif->g_struct_frame_reg[i].frame_type,
vif->g_struct_frame_reg[i].reg);
}
}
wilc_enable_ps = true;
- wilc_set_power_mgmt(priv->hWILCWFIDrv, 1, 0);
+ wilc_set_power_mgmt(vif, priv->hWILCWFIDrv, 1, 0);
}
break;
case NL80211_IFTYPE_P2P_CLIENT:
wilc_enable_ps = false;
- wilc_set_power_mgmt(priv->hWILCWFIDrv, 0, 0);
+ wilc_set_power_mgmt(vif, priv->hWILCWFIDrv, 0, 0);
wilc_connecting = 0;
PRINT_D(HOSTAPD_DBG, "Interface type = NL80211_IFTYPE_P2P_CLIENT\n");
- wilc_del_all_rx_ba_session(priv->hWILCWFIDrv,
+ wilc_del_all_rx_ba_session(vif, priv->hWILCWFIDrv,
wl->vif[0]->bssid, TID);
dev->ieee80211_ptr->iftype = type;
wilc1000_wlan_init(dev, vif);
wilc_initialized = 1;
- wilc_set_wfi_drv_handler(wl->vif[0]->hif_drv);
- wilc_set_mac_address(wl->vif[0]->hif_drv,
+ wilc_set_wfi_drv_handler(vif, wl->vif[0]->hif_drv);
+ wilc_set_mac_address(vif, wl->vif[0]->hif_drv,
wl->vif[0]->src_addr);
- wilc_set_operation_mode(priv->hWILCWFIDrv, STATION_MODE);
+ wilc_set_operation_mode(vif, priv->hWILCWFIDrv, STATION_MODE);
if (g_wep_keys_saved) {
- wilc_set_wep_default_keyid(wl->vif[0]->hif_drv,
+ wilc_set_wep_default_keyid(vif, wl->vif[0]->hif_drv,
g_key_wep_params.key_idx);
- wilc_add_wep_key_bss_sta(wl->vif[0]->hif_drv,
+ wilc_add_wep_key_bss_sta(vif, wl->vif[0]->hif_drv,
g_key_wep_params.key,
g_key_wep_params.key_len,
g_key_wep_params.key_idx);
}
- wilc_flush_join_req(priv->hWILCWFIDrv);
+ wilc_flush_join_req(vif, priv->hWILCWFIDrv);
if (g_ptk_keys_saved && g_gtk_keys_saved) {
PRINT_D(CFG80211_DBG, "ptk %x %x %x\n", g_key_ptk_params.key[0],
for (i = 0; i < num_reg_frame; i++) {
PRINT_D(INIT_DBG, "Frame registering Type: %x - Reg: %d\n", vif->g_struct_frame_reg[i].frame_type,
vif->g_struct_frame_reg[i].reg);
- wilc_frame_register(priv->hWILCWFIDrv,
+ wilc_frame_register(vif, priv->hWILCWFIDrv,
vif->g_struct_frame_reg[i].frame_type,
vif->g_struct_frame_reg[i].reg);
}
for (i = 0; i < num_reg_frame; i++) {
PRINT_D(INIT_DBG, "Frame registering Type: %x - Reg: %d\n", vif->g_struct_frame_reg[i].frame_type,
vif->g_struct_frame_reg[i].reg);
- wilc_frame_register(priv->hWILCWFIDrv,
+ wilc_frame_register(vif, priv->hWILCWFIDrv,
vif->g_struct_frame_reg[i].frame_type,
vif->g_struct_frame_reg[i].reg);
}
wilc_optaining_ip = true;
mod_timer(&wilc_during_ip_timer,
jiffies + msecs_to_jiffies(during_ip_time));
- wilc_set_power_mgmt(priv->hWILCWFIDrv, 0, 0);
- wilc_del_all_rx_ba_session(priv->hWILCWFIDrv,
+ wilc_set_power_mgmt(vif, priv->hWILCWFIDrv, 0, 0);
+ wilc_del_all_rx_ba_session(vif, priv->hWILCWFIDrv,
wl->vif[0]->bssid, TID);
wilc_enable_ps = false;
PRINT_D(HOSTAPD_DBG, "Interface type = NL80211_IFTYPE_GO\n");
wilc1000_wlan_init(dev, vif);
wilc_initialized = 1;
- wilc_set_wfi_drv_handler(wl->vif[0]->hif_drv);
- wilc_set_mac_address(wl->vif[0]->hif_drv,
+ wilc_set_wfi_drv_handler(vif, wl->vif[0]->hif_drv);
+ wilc_set_mac_address(vif, wl->vif[0]->hif_drv,
wl->vif[0]->src_addr);
- wilc_set_operation_mode(priv->hWILCWFIDrv, AP_MODE);
+ wilc_set_operation_mode(vif, priv->hWILCWFIDrv, AP_MODE);
if (g_wep_keys_saved) {
- wilc_set_wep_default_keyid(wl->vif[0]->hif_drv,
+ wilc_set_wep_default_keyid(vif, wl->vif[0]->hif_drv,
g_key_wep_params.key_idx);
- wilc_add_wep_key_bss_sta(wl->vif[0]->hif_drv,
+ wilc_add_wep_key_bss_sta(vif, wl->vif[0]->hif_drv,
g_key_wep_params.key,
g_key_wep_params.key_len,
g_key_wep_params.key_idx);
}
- wilc_flush_join_req(priv->hWILCWFIDrv);
+ wilc_flush_join_req(vif, priv->hWILCWFIDrv);
if (g_ptk_keys_saved && g_gtk_keys_saved) {
PRINT_D(CFG80211_DBG, "ptk %x %x %x cipher %x\n", g_key_ptk_params.key[0],
for (i = 0; i < num_reg_frame; i++) {
PRINT_D(INIT_DBG, "Frame registering Type: %x - Reg: %d\n", vif->g_struct_frame_reg[i].frame_type,
vif->g_struct_frame_reg[i].reg);
- wilc_frame_register(priv->hWILCWFIDrv,
+ wilc_frame_register(vif, priv->hWILCWFIDrv,
vif->g_struct_frame_reg[i].frame_type,
vif->g_struct_frame_reg[i].reg);
}
wilc_wlan_set_bssid(dev, wl->vif[0]->src_addr);
- s32Error = wilc_add_beacon(priv->hWILCWFIDrv,
+ s32Error = wilc_add_beacon(vif, priv->hWILCWFIDrv,
settings->beacon_interval,
settings->dtim_period,
beacon->head_len, (u8 *)beacon->head,
struct cfg80211_beacon_data *beacon)
{
struct wilc_priv *priv;
+ struct wilc_vif *vif;
s32 s32Error = 0;
priv = wiphy_priv(wiphy);
+ vif = netdev_priv(priv->dev);
PRINT_D(HOSTAPD_DBG, "Setting beacon\n");
- s32Error = wilc_add_beacon(priv->hWILCWFIDrv,
+ s32Error = wilc_add_beacon(vif, priv->hWILCWFIDrv,
0,
0,
beacon->head_len, (u8 *)beacon->head,
{
s32 s32Error = 0;
struct wilc_priv *priv;
+ struct wilc_vif *vif;
u8 NullBssid[ETH_ALEN] = {0};
if (!wiphy)
return -EFAULT;
priv = wiphy_priv(wiphy);
+ vif = netdev_priv(priv->dev);
PRINT_D(HOSTAPD_DBG, "Deleting beacon\n");
wilc_wlan_set_bssid(dev, NullBssid);
- s32Error = wilc_del_beacon(priv->hWILCWFIDrv);
+ s32Error = wilc_del_beacon(vif, priv->hWILCWFIDrv);
if (s32Error)
PRINT_ER("Host delete beacon fail\n");
PRINT_D(HOSTAPD_DBG, "Flag Set = %d\n",
strStaParams.flags_set);
- s32Error = wilc_add_station(priv->hWILCWFIDrv, &strStaParams);
+ s32Error = wilc_add_station(vif, priv->hWILCWFIDrv,
+ &strStaParams);
if (s32Error)
PRINT_ER("Host add station fail\n");
}
if (!mac) {
PRINT_D(HOSTAPD_DBG, "All associated stations\n");
- s32Error = wilc_del_allstation(priv->hWILCWFIDrv, priv->assoc_stainfo.au8Sta_AssociatedBss);
+ s32Error = wilc_del_allstation(vif, priv->hWILCWFIDrv, priv->assoc_stainfo.au8Sta_AssociatedBss);
} else {
PRINT_D(HOSTAPD_DBG, "With mac address: %x%x%x%x%x%x\n", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
}
- s32Error = wilc_del_station(priv->hWILCWFIDrv, mac);
+ s32Error = wilc_del_station(vif, priv->hWILCWFIDrv, mac);
if (s32Error)
PRINT_ER("Host delete station fail\n");
PRINT_D(HOSTAPD_DBG, "Flag Set = %d\n",
strStaParams.flags_set);
- s32Error = wilc_edit_station(priv->hWILCWFIDrv, &strStaParams);
+ s32Error = wilc_edit_station(vif, priv->hWILCWFIDrv,
+ &strStaParams);
if (s32Error)
PRINT_ER("Host edit station fail\n");
}
int wilc_deinit_host_int(struct net_device *net)
{
int s32Error = 0;
-
+ struct wilc_vif *vif;
struct wilc_priv *priv;
priv = wdev_priv(net->ieee80211_ptr);
+ vif = netdev_priv(priv->dev);
priv->gbAutoRateAdjusted = false;
op_ifcs--;
- s32Error = wilc_deinit(priv->hWILCWFIDrv);
+ s32Error = wilc_deinit(vif, priv->hWILCWFIDrv);
clear_shadow_scan();
if (op_ifcs == 0) {