Commit 080f11bb authored by Tony Cho's avatar Tony Cho Committed by Greg Kroah-Hartman

staging: wilc1000: change the type of wilc1000_initialized

This patch changes the type of wilc1000_initialized in the struc wilc from int
to bool and also renames it to the initialized. In addition, unnecessary
wilc1000_initialized codes are removed in this patch.
Signed-off-by: default avatarTony Cho <tony.cho@atmel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 91109e11
...@@ -884,9 +884,7 @@ static int linux_wlan_init_test_config(struct net_device *dev, struct wilc *p_ni ...@@ -884,9 +884,7 @@ static int linux_wlan_init_test_config(struct net_device *dev, struct wilc *p_ni
/**************************/ /**************************/
void wilc1000_wlan_deinit(struct wilc *nic) void wilc1000_wlan_deinit(struct wilc *nic)
{ {
if (g_linux_wlan->initialized) {
if (g_linux_wlan->wilc1000_initialized) {
printk("Deinitializing wilc1000 ...\n"); printk("Deinitializing wilc1000 ...\n");
if (nic == NULL) { if (nic == NULL) {
...@@ -935,7 +933,7 @@ void wilc1000_wlan_deinit(struct wilc *nic) ...@@ -935,7 +933,7 @@ void wilc1000_wlan_deinit(struct wilc *nic)
wlan_deinit_locks(g_linux_wlan); wlan_deinit_locks(g_linux_wlan);
/* announce that wilc1000 is not initialized */ /* announce that wilc1000 is not initialized */
g_linux_wlan->wilc1000_initialized = 0; g_linux_wlan->initialized = false;
PRINT_D(INIT_DBG, "wilc1000 deinitialization Done\n"); PRINT_D(INIT_DBG, "wilc1000 deinitialization Done\n");
...@@ -1143,10 +1141,9 @@ int wilc1000_wlan_init(struct net_device *dev, perInterface_wlan_t *p_nic) ...@@ -1143,10 +1141,9 @@ int wilc1000_wlan_init(struct net_device *dev, perInterface_wlan_t *p_nic)
perInterface_wlan_t *nic = p_nic; perInterface_wlan_t *nic = p_nic;
int ret = 0; int ret = 0;
if (!g_linux_wlan->wilc1000_initialized) { if (!g_linux_wlan->initialized) {
g_linux_wlan->mac_status = WILC_MAC_STATUS_INIT; g_linux_wlan->mac_status = WILC_MAC_STATUS_INIT;
g_linux_wlan->close = 0; g_linux_wlan->close = 0;
g_linux_wlan->wilc1000_initialized = 0;
wlan_init_locks(g_linux_wlan); wlan_init_locks(g_linux_wlan);
...@@ -1233,7 +1230,7 @@ int wilc1000_wlan_init(struct net_device *dev, perInterface_wlan_t *p_nic) ...@@ -1233,7 +1230,7 @@ int wilc1000_wlan_init(struct net_device *dev, perInterface_wlan_t *p_nic)
goto _fail_fw_start_; goto _fail_fw_start_;
} }
g_linux_wlan->wilc1000_initialized = 1; g_linux_wlan->initialized = true;
return 0; /*success*/ return 0; /*success*/
_fail_fw_start_: _fail_fw_start_:
...@@ -1567,7 +1564,7 @@ int mac_ioctl(struct net_device *ndev, struct ifreq *req, int cmd) ...@@ -1567,7 +1564,7 @@ int mac_ioctl(struct net_device *ndev, struct ifreq *req, int cmd)
/* struct iwreq *wrq = (struct iwreq *) req; // tony moved to case SIOCSIWPRIV */ /* struct iwreq *wrq = (struct iwreq *) req; // tony moved to case SIOCSIWPRIV */
nic = netdev_priv(ndev); nic = netdev_priv(ndev);
if (!g_linux_wlan->wilc1000_initialized) if (!g_linux_wlan->initialized)
return 0; return 0;
switch (cmd) { switch (cmd) {
......
...@@ -2418,7 +2418,7 @@ void wilc_mgmt_frame_register(struct wiphy *wiphy, struct wireless_dev *wdev, ...@@ -2418,7 +2418,7 @@ void wilc_mgmt_frame_register(struct wiphy *wiphy, struct wireless_dev *wdev,
} }
/*If mac is closed, then return*/ /*If mac is closed, then return*/
if (!g_linux_wlan->wilc1000_initialized) { if (!g_linux_wlan->initialized) {
PRINT_D(GENERIC_DBG, "Return since mac is closed\n"); PRINT_D(GENERIC_DBG, "Return since mac is closed\n");
return; return;
} }
...@@ -2571,7 +2571,7 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev, ...@@ -2571,7 +2571,7 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,
interface_type = nic->iftype; interface_type = nic->iftype;
nic->iftype = STATION_MODE; nic->iftype = STATION_MODE;
if (g_linux_wlan->wilc1000_initialized) { if (g_linux_wlan->initialized) {
host_int_del_All_Rx_BASession(priv->hWILCWFIDrv, g_linux_wlan->strInterfaceInfo[0].aBSSID, TID); host_int_del_All_Rx_BASession(priv->hWILCWFIDrv, g_linux_wlan->strInterfaceInfo[0].aBSSID, TID);
/* ensure that the message Q is empty */ /* ensure that the message Q is empty */
host_int_wait_msg_queue_idle(); host_int_wait_msg_queue_idle();
...@@ -2627,7 +2627,7 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev, ...@@ -2627,7 +2627,7 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,
(struct key_params *)(&g_key_gtk_params)); (struct key_params *)(&g_key_gtk_params));
} }
if (g_linux_wlan->wilc1000_initialized) { if (g_linux_wlan->initialized) {
for (i = 0; i < num_reg_frame; i++) { for (i = 0; i < num_reg_frame; i++) {
PRINT_D(INIT_DBG, "Frame registering Type: %x - Reg: %d\n", nic->g_struct_frame_reg[i].frame_type, PRINT_D(INIT_DBG, "Frame registering Type: %x - Reg: %d\n", nic->g_struct_frame_reg[i].frame_type,
nic->g_struct_frame_reg[i].reg); nic->g_struct_frame_reg[i].reg);
...@@ -2658,7 +2658,7 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev, ...@@ -2658,7 +2658,7 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,
nic->iftype = CLIENT_MODE; nic->iftype = CLIENT_MODE;
if (g_linux_wlan->wilc1000_initialized) { if (g_linux_wlan->initialized) {
/* ensure that the message Q is empty */ /* ensure that the message Q is empty */
host_int_wait_msg_queue_idle(); host_int_wait_msg_queue_idle();
...@@ -2712,7 +2712,7 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev, ...@@ -2712,7 +2712,7 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,
refresh_scan(priv, 1, true); refresh_scan(priv, 1, true);
Set_machw_change_vir_if(false); Set_machw_change_vir_if(false);
if (g_linux_wlan->wilc1000_initialized) { if (g_linux_wlan->initialized) {
for (i = 0; i < num_reg_frame; i++) { for (i = 0; i < num_reg_frame; i++) {
PRINT_D(INIT_DBG, "Frame registering Type: %x - Reg: %d\n", nic->g_struct_frame_reg[i].frame_type, PRINT_D(INIT_DBG, "Frame registering Type: %x - Reg: %d\n", nic->g_struct_frame_reg[i].frame_type,
nic->g_struct_frame_reg[i].reg); nic->g_struct_frame_reg[i].reg);
...@@ -2735,9 +2735,8 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev, ...@@ -2735,9 +2735,8 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,
PRINT_D(HOSTAPD_DBG, "Downloading AP firmware\n"); PRINT_D(HOSTAPD_DBG, "Downloading AP firmware\n");
linux_wlan_get_firmware(nic); linux_wlan_get_firmware(nic);
/*If wilc is running, then close-open to actually get new firmware running (serves P2P)*/ /*If wilc is running, then close-open to actually get new firmware running (serves P2P)*/
if (g_linux_wlan->wilc1000_initialized) { if (g_linux_wlan->initialized) {
nic->iftype = AP_MODE; nic->iftype = AP_MODE;
g_linux_wlan->wilc1000_initialized = 1;
mac_close(dev); mac_close(dev);
mac_open(dev); mac_open(dev);
...@@ -2826,7 +2825,7 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev, ...@@ -2826,7 +2825,7 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,
(struct key_params *)(&g_key_gtk_params)); (struct key_params *)(&g_key_gtk_params));
} }
if (g_linux_wlan->wilc1000_initialized) { if (g_linux_wlan->initialized) {
for (i = 0; i < num_reg_frame; i++) { for (i = 0; i < num_reg_frame; i++) {
PRINT_D(INIT_DBG, "Frame registering Type: %x - Reg: %d\n", nic->g_struct_frame_reg[i].frame_type, PRINT_D(INIT_DBG, "Frame registering Type: %x - Reg: %d\n", nic->g_struct_frame_reg[i].frame_type,
nic->g_struct_frame_reg[i].reg); nic->g_struct_frame_reg[i].reg);
......
...@@ -157,7 +157,7 @@ struct wilc_vif { ...@@ -157,7 +157,7 @@ struct wilc_vif {
struct wilc { struct wilc {
int mac_status; int mac_status;
int wilc1000_initialized; bool initialized;
#if (!defined WILC_SDIO) || (defined WILC_SDIO_IRQ_GPIO) #if (!defined WILC_SDIO) || (defined WILC_SDIO_IRQ_GPIO)
unsigned short dev_irq_num; unsigned short dev_irq_num;
#endif #endif
......
Markdown is supported
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