Merge tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[firefly-linux-kernel-4.4.55.git] / drivers / staging / wilc1000 / wilc_wfi_cfgoperations.c
index 5559aa671b8a641a41cf320f13b2a2a0562bd6a3..3e9501727812c589ba986304cb4689eb87bb4146 100644 (file)
@@ -22,7 +22,6 @@
 #define GET_PKT_OFFSET(a) (((a) >> 22) & 0x1ff)
 
 extern int linux_wlan_get_firmware(perInterface_wlan_t *p_nic);
-extern u16 Set_machw_change_vir_if(bool bValue);
 
 extern int mac_open(struct net_device *ndev);
 extern int mac_close(struct net_device *ndev);
@@ -892,7 +891,7 @@ static int connect(struct wiphy *wiphy, struct net_device *dev,
                        g_key_wep_params.key_idx = sme->key_idx;
                        g_wep_keys_saved = true;
 
-                       host_int_set_WEPDefaultKeyID(priv->hWILCWFIDrv, sme->key_idx);
+                       host_int_set_wep_default_key(priv->hWILCWFIDrv, sme->key_idx);
                        host_int_add_wep_key_bss_sta(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;
@@ -909,7 +908,7 @@ static int connect(struct wiphy *wiphy, struct net_device *dev,
                        g_key_wep_params.key_idx = sme->key_idx;
                        g_wep_keys_saved = true;
 
-                       host_int_set_WEPDefaultKeyID(priv->hWILCWFIDrv, sme->key_idx);
+                       host_int_set_wep_default_key(priv->hWILCWFIDrv, sme->key_idx);
                        host_int_add_wep_key_bss_sta(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) {
@@ -1413,7 +1412,7 @@ static int del_key(struct wiphy *wiphy, struct net_device *netdev,
                g_key_gtk_params.seq = NULL;
 
                /*Reset WILC_CHANGING_VIR_IF register to allow adding futrue keys to CE H/W*/
-               Set_machw_change_vir_if(false);
+               Set_machw_change_vir_if(netdev, false);
        }
 
        if (key_index >= 0 && key_index <= 3) {
@@ -1502,7 +1501,7 @@ static int set_default_key(struct wiphy *wiphy, struct net_device *netdev, u8 ke
 
        if (key_index != priv->WILC_WFI_wep_default) {
 
-               host_int_set_WEPDefaultKeyID(priv->hWILCWFIDrv, key_index);
+               host_int_set_wep_default_key(priv->hWILCWFIDrv, key_index);
        }
 
        return 0;
@@ -2179,20 +2178,6 @@ static int cancel_remain_on_channel(struct wiphy *wiphy,
        s32Error = host_int_ListenStateExpired(priv->hWILCWFIDrv, priv->strRemainOnChanParams.u32ListenSessionID);
        return s32Error;
 }
-/**
- *  @brief       WILC_WFI_add_wilcvendorspec
- *  @details    Adding WILC information elemet to allow two WILC devices to
- *                              identify each other and connect
- *  @param[in]   u8 * buf
- *  @return     void
- *  @author    mdaftedar
- *  @date      01 JAN 2014
- *  @version   1.0
- */
-void WILC_WFI_add_wilcvendorspec(u8 *buff)
-{
-       memcpy(buff, u8P2P_vendorspec, sizeof(u8P2P_vendorspec));
-}
 /**
  *  @brief      WILC_WFI_mgmt_tx_frame
  *  @details
@@ -2316,7 +2301,11 @@ static int mgmt_tx(struct wiphy *wiphy,
                                                                }
 
                                                                if (buf[P2P_PUB_ACTION_SUBTYPE] != P2P_INV_REQ && buf[P2P_PUB_ACTION_SUBTYPE] != P2P_INV_RSP) {
-                                                                       WILC_WFI_add_wilcvendorspec(&mgmt_tx->buff[len]);
+                                                                       /*
+                                                                        * Adding WILC information element to allow two WILC devices to
+                                                                        * identify each other and connect
+                                                                        */
+                                                                       memcpy(&mgmt_tx->buff[len], u8P2P_vendorspec, sizeof(u8P2P_vendorspec));
                                                                        mgmt_tx->buff[len + sizeof(u8P2P_vendorspec)] = u8P2Plocalrandom;
                                                                        mgmt_tx->size = buf_len;
                                                                }
@@ -2562,7 +2551,7 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,
        PRINT_D(GENERIC_DBG, "Changing virtual interface, enable scan\n");
        /*Set WILC_CHANGING_VIR_IF register to disallow adding futrue keys to CE H/W*/
        if (g_ptk_keys_saved && g_gtk_keys_saved) {
-               Set_machw_change_vir_if(true);
+               Set_machw_change_vir_if(dev, true);
        }
 
        switch (type) {
@@ -2605,7 +2594,7 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,
 
                        /*Add saved WEP keys, if any*/
                        if (g_wep_keys_saved) {
-                               host_int_set_WEPDefaultKeyID(wl->vif[0].hif_drv,
+                               host_int_set_wep_default_key(wl->vif[0].hif_drv,
                                                             g_key_wep_params.key_idx);
                                host_int_add_wep_key_bss_sta(wl->vif[0].hif_drv,
                                                             g_key_wep_params.key,
@@ -2687,7 +2676,7 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,
 
                        /*Add saved WEP keys, if any*/
                        if (g_wep_keys_saved) {
-                               host_int_set_WEPDefaultKeyID(wl->vif[0].hif_drv,
+                               host_int_set_wep_default_key(wl->vif[0].hif_drv,
                                                             g_key_wep_params.key_idx);
                                host_int_add_wep_key_bss_sta(wl->vif[0].hif_drv,
                                                             g_key_wep_params.key,
@@ -2724,7 +2713,7 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,
 
                        /*Refresh scan, to refresh the scan results to the wpa_supplicant. Set MachHw to false to enable further key installments*/
                        refresh_scan(priv, 1, true);
-                       Set_machw_change_vir_if(false);
+                       Set_machw_change_vir_if(dev, false);
 
                        if (wl->initialized)    {
                                for (i = 0; i < num_reg_frame; i++) {
@@ -2803,7 +2792,7 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,
 
                /*Add saved WEP keys, if any*/
                if (g_wep_keys_saved) {
-                       host_int_set_WEPDefaultKeyID(wl->vif[0].hif_drv,
+                       host_int_set_wep_default_key(wl->vif[0].hif_drv,
                                                     g_key_wep_params.key_idx);
                        host_int_add_wep_key_bss_sta(wl->vif[0].hif_drv,
                                                     g_key_wep_params.key,
@@ -3464,7 +3453,7 @@ int wilc_init_host_int(struct net_device *net)
        priv->bInP2PlistenState = false;
 
        sema_init(&(priv->hSemScanReq), 1);
-       s32Error = host_int_init(&priv->hWILCWFIDrv);
+       s32Error = host_int_init(net, &priv->hWILCWFIDrv);
        if (s32Error)
                PRINT_ER("Error while initializing hostinterface\n");