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

staging: wilc1000: remove typedef from the linux_wlan_t

This patch removes typedef from the struct linux_wlan_t and renames it
to the wilc. In addition, all of linux_wlan_t is replaced with struct wilc
and memory allocation style is changed with preferred form as well like the
following:
	p = kmalloc(sizeof(*p), ...) where "struct wilc" is used
Signed-off-by: default avatarTony Cho <tony.cho@atmel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 9b7ecb01
...@@ -49,7 +49,7 @@ extern bool g_obtainingIP; ...@@ -49,7 +49,7 @@ extern bool g_obtainingIP;
extern u16 Set_machw_change_vir_if(bool bValue); extern u16 Set_machw_change_vir_if(bool bValue);
extern void resolve_disconnect_aberration(void *drvHandler); extern void resolve_disconnect_aberration(void *drvHandler);
extern u8 gau8MulticastMacAddrList[WILC_MULTICAST_TABLE_SIZE][ETH_ALEN]; extern u8 gau8MulticastMacAddrList[WILC_MULTICAST_TABLE_SIZE][ETH_ALEN];
void wilc1000_wlan_deinit(linux_wlan_t *nic); void wilc1000_wlan_deinit(struct wilc *nic);
extern struct timer_list hDuringIpTimer; extern struct timer_list hDuringIpTimer;
static int linux_wlan_device_power(int on_off) static int linux_wlan_device_power(int on_off)
...@@ -96,8 +96,8 @@ static struct notifier_block g_dev_notifier = { ...@@ -96,8 +96,8 @@ static struct notifier_block g_dev_notifier = {
*/ */
static struct semaphore close_exit_sync; static struct semaphore close_exit_sync;
static int wlan_deinit_locks(linux_wlan_t *nic); static int wlan_deinit_locks(struct wilc *nic);
static void wlan_deinitialize_threads(linux_wlan_t *nic); static void wlan_deinitialize_threads(struct wilc *nic);
extern void WILC_WFI_monitor_rx(u8 *buff, u32 size); extern void WILC_WFI_monitor_rx(u8 *buff, u32 size);
extern void WILC_WFI_p2p_rx(struct net_device *dev, u8 *buff, u32 size); extern void WILC_WFI_p2p_rx(struct net_device *dev, u8 *buff, u32 size);
...@@ -114,7 +114,7 @@ static void wilc_set_multicast_list(struct net_device *dev); ...@@ -114,7 +114,7 @@ static void wilc_set_multicast_list(struct net_device *dev);
* for now - in frmw_to_linux there should be private data to be passed to it * for now - in frmw_to_linux there should be private data to be passed to it
* and this data should be pointer to net device * and this data should be pointer to net device
*/ */
linux_wlan_t *g_linux_wlan; struct wilc *g_linux_wlan;
bool bEnablePS = true; bool bEnablePS = true;
static const struct net_device_ops wilc_netdev_ops = { static const struct net_device_ops wilc_netdev_ops = {
...@@ -243,9 +243,9 @@ static irqreturn_t isr_uh_routine(int irq, void *user_data) ...@@ -243,9 +243,9 @@ static irqreturn_t isr_uh_routine(int irq, void *user_data)
irqreturn_t isr_bh_routine(int irq, void *userdata) irqreturn_t isr_bh_routine(int irq, void *userdata)
{ {
linux_wlan_t *nic; struct wilc *nic;
nic = (linux_wlan_t *)userdata; nic = (struct wilc *)userdata;
/*While mac is closing cacncel the handling of any interrupts received*/ /*While mac is closing cacncel the handling of any interrupts received*/
if (g_linux_wlan->close) { if (g_linux_wlan->close) {
...@@ -260,10 +260,10 @@ irqreturn_t isr_bh_routine(int irq, void *userdata) ...@@ -260,10 +260,10 @@ irqreturn_t isr_bh_routine(int irq, void *userdata)
} }
#if (defined WILC_SPI) || (defined WILC_SDIO_IRQ_GPIO) #if (defined WILC_SPI) || (defined WILC_SDIO_IRQ_GPIO)
static int init_irq(linux_wlan_t *p_nic) static int init_irq(struct wilc *p_nic)
{ {
int ret = 0; int ret = 0;
linux_wlan_t *nic = p_nic; struct wilc *nic = p_nic;
/*initialize GPIO and register IRQ num*/ /*initialize GPIO and register IRQ num*/
/*GPIO request*/ /*GPIO request*/
...@@ -299,7 +299,7 @@ static int init_irq(linux_wlan_t *p_nic) ...@@ -299,7 +299,7 @@ static int init_irq(linux_wlan_t *p_nic)
} }
#endif #endif
static void deinit_irq(linux_wlan_t *nic) static void deinit_irq(struct wilc *nic)
{ {
#if (defined WILC_SPI) || (defined WILC_SDIO_IRQ_GPIO) #if (defined WILC_SPI) || (defined WILC_SDIO_IRQ_GPIO)
/* Deintialize IRQ */ /* Deintialize IRQ */
...@@ -336,7 +336,7 @@ void linux_wlan_mac_indicate(int flag) ...@@ -336,7 +336,7 @@ void linux_wlan_mac_indicate(int flag)
/*I have to do it that way becuase there is no mean to encapsulate device pointer /*I have to do it that way becuase there is no mean to encapsulate device pointer
* as a parameter * as a parameter
*/ */
linux_wlan_t *pd = g_linux_wlan; struct wilc *pd = g_linux_wlan;
int status; int status;
if (flag == WILC_MAC_INDICATE_STATUS) { if (flag == WILC_MAC_INDICATE_STATUS) {
...@@ -594,7 +594,7 @@ static int linux_wlan_start_firmware(perInterface_wlan_t *nic) ...@@ -594,7 +594,7 @@ static int linux_wlan_start_firmware(perInterface_wlan_t *nic)
_fail_: _fail_:
return ret; return ret;
} }
static int linux_wlan_firmware_download(linux_wlan_t *p_nic) static int linux_wlan_firmware_download(struct wilc *p_nic)
{ {
int ret = 0; int ret = 0;
...@@ -626,7 +626,7 @@ static int linux_wlan_firmware_download(linux_wlan_t *p_nic) ...@@ -626,7 +626,7 @@ static int linux_wlan_firmware_download(linux_wlan_t *p_nic)
} }
/* startup configuration - could be changed later using iconfig*/ /* startup configuration - could be changed later using iconfig*/
static int linux_wlan_init_test_config(struct net_device *dev, linux_wlan_t *p_nic) static int linux_wlan_init_test_config(struct net_device *dev, struct wilc *p_nic)
{ {
unsigned char c_val[64]; unsigned char c_val[64];
...@@ -882,7 +882,7 @@ static int linux_wlan_init_test_config(struct net_device *dev, linux_wlan_t *p_n ...@@ -882,7 +882,7 @@ static int linux_wlan_init_test_config(struct net_device *dev, linux_wlan_t *p_n
} }
/**************************/ /**************************/
void wilc1000_wlan_deinit(linux_wlan_t *nic) void wilc1000_wlan_deinit(struct wilc *nic)
{ {
if (g_linux_wlan->wilc1000_initialized) { if (g_linux_wlan->wilc1000_initialized) {
...@@ -944,7 +944,7 @@ void wilc1000_wlan_deinit(linux_wlan_t *nic) ...@@ -944,7 +944,7 @@ void wilc1000_wlan_deinit(linux_wlan_t *nic)
} }
} }
int wlan_init_locks(linux_wlan_t *p_nic) int wlan_init_locks(struct wilc *p_nic)
{ {
PRINT_D(INIT_DBG, "Initializing Locks ...\n"); PRINT_D(INIT_DBG, "Initializing Locks ...\n");
...@@ -965,7 +965,7 @@ int wlan_init_locks(linux_wlan_t *p_nic) ...@@ -965,7 +965,7 @@ int wlan_init_locks(linux_wlan_t *p_nic)
return 0; return 0;
} }
static int wlan_deinit_locks(linux_wlan_t *nic) static int wlan_deinit_locks(struct wilc *nic)
{ {
PRINT_D(INIT_DBG, "De-Initializing Locks\n"); PRINT_D(INIT_DBG, "De-Initializing Locks\n");
...@@ -977,7 +977,7 @@ static int wlan_deinit_locks(linux_wlan_t *nic) ...@@ -977,7 +977,7 @@ static int wlan_deinit_locks(linux_wlan_t *nic)
return 0; return 0;
} }
void linux_to_wlan(wilc_wlan_inp_t *nwi, linux_wlan_t *nic) void linux_to_wlan(wilc_wlan_inp_t *nwi, struct wilc *nic)
{ {
PRINT_D(INIT_DBG, "Linux to Wlan services ...\n"); PRINT_D(INIT_DBG, "Linux to Wlan services ...\n");
...@@ -1031,7 +1031,7 @@ int wlan_initialize_threads(perInterface_wlan_t *nic) ...@@ -1031,7 +1031,7 @@ int wlan_initialize_threads(perInterface_wlan_t *nic)
return ret; return ret;
} }
static void wlan_deinitialize_threads(linux_wlan_t *nic) static void wlan_deinitialize_threads(struct wilc *nic)
{ {
g_linux_wlan->close = 1; g_linux_wlan->close = 1;
...@@ -1053,7 +1053,7 @@ extern u8 core_11b_ready(void); ...@@ -1053,7 +1053,7 @@ extern u8 core_11b_ready(void);
#define READY_CHECK_THRESHOLD 30 #define READY_CHECK_THRESHOLD 30
extern void wilc_wlan_global_reset(void); extern void wilc_wlan_global_reset(void);
u8 wilc1000_prepare_11b_core(wilc_wlan_inp_t *nwi, linux_wlan_t *nic) u8 wilc1000_prepare_11b_core(wilc_wlan_inp_t *nwi, struct wilc *nic)
{ {
u8 trials = 0; u8 trials = 0;
...@@ -1714,7 +1714,7 @@ int wilc_netdev_init(void) ...@@ -1714,7 +1714,7 @@ int wilc_netdev_init(void)
sema_init(&close_exit_sync, 0); sema_init(&close_exit_sync, 0);
/*create the common structure*/ /*create the common structure*/
g_linux_wlan = kzalloc(sizeof(linux_wlan_t), GFP_KERNEL); g_linux_wlan = kzalloc(sizeof(*g_linux_wlan), GFP_KERNEL);
if (!g_linux_wlan) if (!g_linux_wlan)
return -ENOMEM; return -ENOMEM;
......
...@@ -2523,7 +2523,7 @@ static int set_power_mgmt(struct wiphy *wiphy, struct net_device *dev, ...@@ -2523,7 +2523,7 @@ static int set_power_mgmt(struct wiphy *wiphy, struct net_device *dev,
* @date 01 MAR 2012 * @date 01 MAR 2012
* @version 1.0 * @version 1.0
*/ */
void wilc1000_wlan_deinit(linux_wlan_t *nic); void wilc1000_wlan_deinit(struct wilc *nic);
int wilc1000_wlan_init(struct net_device *dev, perInterface_wlan_t *p_nic); int wilc1000_wlan_init(struct net_device *dev, perInterface_wlan_t *p_nic);
static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev, static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,
......
...@@ -154,7 +154,8 @@ typedef struct { ...@@ -154,7 +154,8 @@ typedef struct {
struct host_if_drv *drvHandler; struct host_if_drv *drvHandler;
struct net_device *wilc_netdev; struct net_device *wilc_netdev;
} tstrInterfaceInfo; } tstrInterfaceInfo;
typedef struct {
struct wilc {
int mac_status; int mac_status;
int wilc1000_initialized; int wilc1000_initialized;
#if (!defined WILC_SDIO) || (defined WILC_SDIO_IRQ_GPIO) #if (!defined WILC_SDIO) || (defined WILC_SDIO_IRQ_GPIO)
...@@ -188,8 +189,7 @@ typedef struct { ...@@ -188,8 +189,7 @@ typedef struct {
#else #else
struct spi_device *wilc_spidev; struct spi_device *wilc_spidev;
#endif #endif
};
} linux_wlan_t;
typedef struct { typedef struct {
u8 u8IfIdx; u8 u8IfIdx;
...@@ -206,7 +206,7 @@ struct WILC_WFI_mon_priv { ...@@ -206,7 +206,7 @@ struct WILC_WFI_mon_priv {
struct net_device *real_ndev; struct net_device *real_ndev;
}; };
extern linux_wlan_t *g_linux_wlan; extern struct wilc *g_linux_wlan;
extern struct net_device *WILC_WFI_devs[]; extern struct net_device *WILC_WFI_devs[];
void frmw_to_linux(u8 *buff, u32 size, u32 pkt_offset); void frmw_to_linux(u8 *buff, u32 size, u32 pkt_offset);
void linux_wlan_mac_indicate(int flag); void linux_wlan_mac_indicate(int flag);
......
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