Commit cf60106b authored by Glen Lee's avatar Glen Lee Committed by Greg Kroah-Hartman
Browse files

staging: wilc1000: pass vif to hostIFthread



We will pass vif, which is currently being used as net_device, instead of
hif_dev. This is the first step to use index of vif to pass to the driver.
Add new argument vif to all the functions that send message to hostIFthread and
set vif to msg.vif. As a result, hostIfthread will get vif.
In later patch, we will remove drv of host_if_msg and use vif instead of it.
Signed-off-by: default avatarGlen Lee <glen.lee@atmel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 1006b5c7
This diff is collapsed.
......@@ -305,97 +305,104 @@ struct add_sta_param {
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];
......
......@@ -112,7 +112,7 @@ static int dev_state_ev_handler(struct notifier_block *this, unsigned long event
}
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);
......@@ -120,7 +120,7 @@ static int dev_state_ev_handler(struct notifier_block *this, unsigned long event
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;
......@@ -134,9 +134,9 @@ static int dev_state_ev_handler(struct notifier_block *this, unsigned long event
}
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);
......@@ -145,7 +145,7 @@ static int dev_state_ev_handler(struct notifier_block *this, unsigned long event
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;
......@@ -1030,7 +1030,7 @@ int wilc_mac_open(struct net_device *ndev)
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++) {
......@@ -1076,9 +1076,11 @@ static void wilc_set_multicast_list(struct net_device *dev)
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)
......@@ -1095,13 +1097,13 @@ static void wilc_set_multicast_list(struct net_device *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;
}
......@@ -1117,7 +1119,7 @@ static void wilc_set_multicast_list(struct net_device *dev)
i++;
}
wilc_setup_multicast_filter(hif_drv, true, (dev->mc.count));
wilc_setup_multicast_filter(vif, hif_drv, true, (dev->mc.count));
return;
}
......@@ -1289,7 +1291,7 @@ static int mac_ioctl(struct net_device *ndev, struct ifreq *req, int cmd)
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);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment