Commit a4cac481 authored by Glen Lee's avatar Glen Lee Committed by Greg Kroah-Hartman

staging: wilc1000: move perInterface_wlan_t to wilc_vif

perInterface_wlan_t and wilc_vif are all about interface control informations.
We will combine those two structures and maintain as one network interface
control information.
Move all the members of perInterface_wlan_t to wilc_vif and remove the
structure. Rename perInterace_wlan_t to wilc_vif and rename variable name nic
to vif which is proper name for it.
Signed-off-by: default avatarGlen Lee <glen.lee@atmel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 320edd03
...@@ -3779,11 +3779,11 @@ s32 wilc_init(struct net_device *dev, struct host_if_drv **hif_drv_handler) ...@@ -3779,11 +3779,11 @@ s32 wilc_init(struct net_device *dev, struct host_if_drv **hif_drv_handler)
s32 result = 0; s32 result = 0;
struct host_if_drv *hif_drv; struct host_if_drv *hif_drv;
int err; int err;
perInterface_wlan_t *nic; struct wilc_vif *vif;
struct wilc *wilc; struct wilc *wilc;
nic = netdev_priv(dev); vif = netdev_priv(dev);
wilc = nic->wilc; wilc = vif->wilc;
PRINT_D(HOSTINF_DBG, "Initializing host interface for client %d\n", clients_count + 1); PRINT_D(HOSTINF_DBG, "Initializing host interface for client %d\n", clients_count + 1);
......
This diff is collapsed.
...@@ -149,6 +149,14 @@ typedef struct { ...@@ -149,6 +149,14 @@ typedef struct {
} struct_frame_reg; } struct_frame_reg;
struct wilc_vif { struct wilc_vif {
u8 u8IfIdx;
u8 iftype;
int monitor_flag;
int mac_opened;
struct_frame_reg g_struct_frame_reg[num_reg_frame];
struct net_device *wilc_netdev;
struct net_device_stats netstats;
struct wilc *wilc;
u8 src_addr[ETH_ALEN]; u8 src_addr[ETH_ALEN];
u8 bssid[ETH_ALEN]; u8 bssid[ETH_ALEN];
struct host_if_drv *hif_drv; struct host_if_drv *hif_drv;
...@@ -210,22 +218,11 @@ struct wilc { ...@@ -210,22 +218,11 @@ struct wilc {
struct device *dev; struct device *dev;
}; };
typedef struct {
u8 u8IfIdx;
u8 iftype;
int monitor_flag;
int mac_opened;
struct_frame_reg g_struct_frame_reg[num_reg_frame];
struct net_device *wilc_netdev;
struct net_device_stats netstats;
struct wilc *wilc;
} perInterface_wlan_t;
struct WILC_WFI_mon_priv { struct WILC_WFI_mon_priv {
struct net_device *real_ndev; struct net_device *real_ndev;
}; };
int wilc1000_wlan_init(struct net_device *dev, perInterface_wlan_t *p_nic); int wilc1000_wlan_init(struct net_device *dev, struct wilc_vif *vif);
void wilc_frmw_to_linux(struct wilc *wilc, u8 *buff, u32 size, u32 pkt_offset); void wilc_frmw_to_linux(struct wilc *wilc, u8 *buff, u32 size, u32 pkt_offset);
void wilc_mac_indicate(struct wilc *wilc, int flag); void wilc_mac_indicate(struct wilc *wilc, int flag);
......
...@@ -72,11 +72,11 @@ wilc_wlan_txq_remove_from_head(struct net_device *dev) ...@@ -72,11 +72,11 @@ wilc_wlan_txq_remove_from_head(struct net_device *dev)
{ {
struct txq_entry_t *tqe; struct txq_entry_t *tqe;
unsigned long flags; unsigned long flags;
perInterface_wlan_t *nic; struct wilc_vif *vif;
struct wilc *wilc; struct wilc *wilc;
nic = netdev_priv(dev); vif = netdev_priv(dev);
wilc = nic->wilc; wilc = vif->wilc;
spin_lock_irqsave(&wilc->txq_spinlock, flags); spin_lock_irqsave(&wilc->txq_spinlock, flags);
if (wilc->txq_head) { if (wilc->txq_head) {
...@@ -97,11 +97,11 @@ static void wilc_wlan_txq_add_to_tail(struct net_device *dev, ...@@ -97,11 +97,11 @@ static void wilc_wlan_txq_add_to_tail(struct net_device *dev,
struct txq_entry_t *tqe) struct txq_entry_t *tqe)
{ {
unsigned long flags; unsigned long flags;
perInterface_wlan_t *nic; struct wilc_vif *vif;
struct wilc *wilc; struct wilc *wilc;
nic = netdev_priv(dev); vif = netdev_priv(dev);
wilc = nic->wilc; wilc = vif->wilc;
spin_lock_irqsave(&wilc->txq_spinlock, flags); spin_lock_irqsave(&wilc->txq_spinlock, flags);
...@@ -239,11 +239,11 @@ static inline int tcp_process(struct net_device *dev, struct txq_entry_t *tqe) ...@@ -239,11 +239,11 @@ static inline int tcp_process(struct net_device *dev, struct txq_entry_t *tqe)
unsigned short h_proto; unsigned short h_proto;
int i; int i;
unsigned long flags; unsigned long flags;
perInterface_wlan_t *nic; struct wilc_vif *vif;
struct wilc *wilc; struct wilc *wilc;
nic = netdev_priv(dev); vif = netdev_priv(dev);
wilc = nic->wilc; wilc = vif->wilc;
eth_hdr_ptr = &buffer[0]; eth_hdr_ptr = &buffer[0];
...@@ -301,13 +301,13 @@ static inline int tcp_process(struct net_device *dev, struct txq_entry_t *tqe) ...@@ -301,13 +301,13 @@ static inline int tcp_process(struct net_device *dev, struct txq_entry_t *tqe)
static int wilc_wlan_txq_filter_dup_tcp_ack(struct net_device *dev) static int wilc_wlan_txq_filter_dup_tcp_ack(struct net_device *dev)
{ {
perInterface_wlan_t *nic; struct wilc_vif *vif;
struct wilc *wilc; struct wilc *wilc;
u32 i = 0; u32 i = 0;
u32 dropped = 0; u32 dropped = 0;
nic = netdev_priv(dev); vif = netdev_priv(dev);
wilc = nic->wilc; wilc = vif->wilc;
spin_lock_irqsave(&wilc->txq_spinlock, wilc->txq_spinlock_flags); spin_lock_irqsave(&wilc->txq_spinlock, wilc->txq_spinlock_flags);
for (i = pending_base; i < (pending_base + pending_acks); i++) { for (i = pending_base; i < (pending_base + pending_acks); i++) {
...@@ -397,10 +397,10 @@ int wilc_wlan_txq_add_net_pkt(struct net_device *dev, void *priv, u8 *buffer, ...@@ -397,10 +397,10 @@ int wilc_wlan_txq_add_net_pkt(struct net_device *dev, void *priv, u8 *buffer,
u32 buffer_size, wilc_tx_complete_func_t func) u32 buffer_size, wilc_tx_complete_func_t func)
{ {
struct txq_entry_t *tqe; struct txq_entry_t *tqe;
perInterface_wlan_t *nic = netdev_priv(dev); struct wilc_vif *vif = netdev_priv(dev);
struct wilc *wilc; struct wilc *wilc;
wilc = nic->wilc; wilc = vif->wilc;
if (wilc->quit) if (wilc->quit)
return 0; return 0;
...@@ -429,10 +429,10 @@ int wilc_wlan_txq_add_mgmt_pkt(struct net_device *dev, void *priv, u8 *buffer, ...@@ -429,10 +429,10 @@ int wilc_wlan_txq_add_mgmt_pkt(struct net_device *dev, void *priv, u8 *buffer,
u32 buffer_size, wilc_tx_complete_func_t func) u32 buffer_size, wilc_tx_complete_func_t func)
{ {
struct txq_entry_t *tqe; struct txq_entry_t *tqe;
perInterface_wlan_t *nic = netdev_priv(dev); struct wilc_vif *vif = netdev_priv(dev);
struct wilc *wilc; struct wilc *wilc;
wilc = nic->wilc; wilc = vif->wilc;
if (wilc->quit) if (wilc->quit)
return 0; return 0;
...@@ -676,11 +676,11 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count) ...@@ -676,11 +676,11 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count)
int counter; int counter;
int timeout; int timeout;
u32 vmm_table[WILC_VMM_TBL_SIZE]; u32 vmm_table[WILC_VMM_TBL_SIZE];
perInterface_wlan_t *nic; struct wilc_vif *vif;
struct wilc *wilc; struct wilc *wilc;
nic = netdev_priv(dev); vif = netdev_priv(dev);
wilc = nic->wilc; wilc = vif->wilc;
txb = wilc->tx_buffer; txb = wilc->tx_buffer;
wilc->txq_exit = 0; wilc->txq_exit = 0;
...@@ -1348,11 +1348,11 @@ void wilc_wlan_cleanup(struct net_device *dev) ...@@ -1348,11 +1348,11 @@ void wilc_wlan_cleanup(struct net_device *dev)
struct rxq_entry_t *rqe; struct rxq_entry_t *rqe;
u32 reg = 0; u32 reg = 0;
int ret; int ret;
perInterface_wlan_t *nic; struct wilc_vif *vif;
struct wilc *wilc; struct wilc *wilc;
nic = netdev_priv(dev); vif = netdev_priv(dev);
wilc = nic->wilc; wilc = vif->wilc;
wilc->quit = 1; wilc->quit = 1;
do { do {
...@@ -1510,11 +1510,11 @@ static u32 init_chip(struct net_device *dev) ...@@ -1510,11 +1510,11 @@ static u32 init_chip(struct net_device *dev)
{ {
u32 chipid; u32 chipid;
u32 reg, ret = 0; u32 reg, ret = 0;
perInterface_wlan_t *nic; struct wilc_vif *vif;
struct wilc *wilc; struct wilc *wilc;
nic = netdev_priv(dev); vif = netdev_priv(dev);
wilc = nic->wilc; wilc = vif->wilc;
acquire_bus(wilc, ACQUIRE_ONLY); acquire_bus(wilc, ACQUIRE_ONLY);
...@@ -1580,10 +1580,10 @@ u32 wilc_get_chipid(struct wilc *wilc, u8 update) ...@@ -1580,10 +1580,10 @@ u32 wilc_get_chipid(struct wilc *wilc, u8 update)
int wilc_wlan_init(struct net_device *dev) int wilc_wlan_init(struct net_device *dev)
{ {
int ret = 0; int ret = 0;
perInterface_wlan_t *nic = netdev_priv(dev); struct wilc_vif *vif = netdev_priv(dev);
struct wilc *wilc; struct wilc *wilc;
wilc = nic->wilc; wilc = vif->wilc;
PRINT_D(INIT_DBG, "Initializing WILC_Wlan ...\n"); PRINT_D(INIT_DBG, "Initializing WILC_Wlan ...\n");
...@@ -1640,11 +1640,11 @@ u16 wilc_set_machw_change_vir_if(struct net_device *dev, bool value) ...@@ -1640,11 +1640,11 @@ u16 wilc_set_machw_change_vir_if(struct net_device *dev, bool value)
{ {
u16 ret; u16 ret;
u32 reg; u32 reg;
perInterface_wlan_t *nic; struct wilc_vif *vif;
struct wilc *wilc; struct wilc *wilc;
nic = netdev_priv(dev); vif = netdev_priv(dev);
wilc = nic->wilc; wilc = vif->wilc;
mutex_lock(&wilc->hif_cs); mutex_lock(&wilc->hif_cs);
ret = wilc->hif_func->hif_read_reg(wilc, WILC_CHANGING_VIR_IF, ret = wilc->hif_func->hif_read_reg(wilc, WILC_CHANGING_VIR_IF,
......
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