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)
s32 result = 0;
struct host_if_drv *hif_drv;
int err;
perInterface_wlan_t *nic;
struct wilc_vif *vif;
struct wilc *wilc;
nic = netdev_priv(dev);
wilc = nic->wilc;
vif = netdev_priv(dev);
wilc = vif->wilc;
PRINT_D(HOSTINF_DBG, "Initializing host interface for client %d\n", clients_count + 1);
......
This diff is collapsed.
......@@ -149,6 +149,14 @@ typedef struct {
} struct_frame_reg;
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 bssid[ETH_ALEN];
struct host_if_drv *hif_drv;
......@@ -210,22 +218,11 @@ struct wilc {
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 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_mac_indicate(struct wilc *wilc, int flag);
......
......@@ -72,11 +72,11 @@ wilc_wlan_txq_remove_from_head(struct net_device *dev)
{
struct txq_entry_t *tqe;
unsigned long flags;
perInterface_wlan_t *nic;
struct wilc_vif *vif;
struct wilc *wilc;
nic = netdev_priv(dev);
wilc = nic->wilc;
vif = netdev_priv(dev);
wilc = vif->wilc;
spin_lock_irqsave(&wilc->txq_spinlock, flags);
if (wilc->txq_head) {
......@@ -97,11 +97,11 @@ static void wilc_wlan_txq_add_to_tail(struct net_device *dev,
struct txq_entry_t *tqe)
{
unsigned long flags;
perInterface_wlan_t *nic;
struct wilc_vif *vif;
struct wilc *wilc;
nic = netdev_priv(dev);
wilc = nic->wilc;
vif = netdev_priv(dev);
wilc = vif->wilc;
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)
unsigned short h_proto;
int i;
unsigned long flags;
perInterface_wlan_t *nic;
struct wilc_vif *vif;
struct wilc *wilc;
nic = netdev_priv(dev);
wilc = nic->wilc;
vif = netdev_priv(dev);
wilc = vif->wilc;
eth_hdr_ptr = &buffer[0];
......@@ -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)
{
perInterface_wlan_t *nic;
struct wilc_vif *vif;
struct wilc *wilc;
u32 i = 0;
u32 dropped = 0;
nic = netdev_priv(dev);
wilc = nic->wilc;
vif = netdev_priv(dev);
wilc = vif->wilc;
spin_lock_irqsave(&wilc->txq_spinlock, wilc->txq_spinlock_flags);
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,
u32 buffer_size, wilc_tx_complete_func_t func)
{
struct txq_entry_t *tqe;
perInterface_wlan_t *nic = netdev_priv(dev);
struct wilc_vif *vif = netdev_priv(dev);
struct wilc *wilc;
wilc = nic->wilc;
wilc = vif->wilc;
if (wilc->quit)
return 0;
......@@ -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)
{
struct txq_entry_t *tqe;
perInterface_wlan_t *nic = netdev_priv(dev);
struct wilc_vif *vif = netdev_priv(dev);
struct wilc *wilc;
wilc = nic->wilc;
wilc = vif->wilc;
if (wilc->quit)
return 0;
......@@ -676,11 +676,11 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count)
int counter;
int timeout;
u32 vmm_table[WILC_VMM_TBL_SIZE];
perInterface_wlan_t *nic;
struct wilc_vif *vif;
struct wilc *wilc;
nic = netdev_priv(dev);
wilc = nic->wilc;
vif = netdev_priv(dev);
wilc = vif->wilc;
txb = wilc->tx_buffer;
wilc->txq_exit = 0;
......@@ -1348,11 +1348,11 @@ void wilc_wlan_cleanup(struct net_device *dev)
struct rxq_entry_t *rqe;
u32 reg = 0;
int ret;
perInterface_wlan_t *nic;
struct wilc_vif *vif;
struct wilc *wilc;
nic = netdev_priv(dev);
wilc = nic->wilc;
vif = netdev_priv(dev);
wilc = vif->wilc;
wilc->quit = 1;
do {
......@@ -1510,11 +1510,11 @@ static u32 init_chip(struct net_device *dev)
{
u32 chipid;
u32 reg, ret = 0;
perInterface_wlan_t *nic;
struct wilc_vif *vif;
struct wilc *wilc;
nic = netdev_priv(dev);
wilc = nic->wilc;
vif = netdev_priv(dev);
wilc = vif->wilc;
acquire_bus(wilc, ACQUIRE_ONLY);
......@@ -1580,10 +1580,10 @@ u32 wilc_get_chipid(struct wilc *wilc, u8 update)
int wilc_wlan_init(struct net_device *dev)
{
int ret = 0;
perInterface_wlan_t *nic = netdev_priv(dev);
struct wilc_vif *vif = netdev_priv(dev);
struct wilc *wilc;
wilc = nic->wilc;
wilc = vif->wilc;
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)
{
u16 ret;
u32 reg;
perInterface_wlan_t *nic;
struct wilc_vif *vif;
struct wilc *wilc;
nic = netdev_priv(dev);
wilc = nic->wilc;
vif = netdev_priv(dev);
wilc = vif->wilc;
mutex_lock(&wilc->hif_cs);
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