Chinaunix首页 | 论坛 | 博客
  • 博客访问: 290964
  • 博文数量: 95
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 714
  • 用 户 组: 普通用户
  • 注册时间: 2018-10-15 14:13
个人简介

搭建一个和linux开发者知识共享和学习的平台

文章分类

全部博文(95)

文章存档

2024年(9)

2023年(24)

2022年(27)

2019年(8)

2018年(27)

分类: 嵌入式

2023-07-17 16:34:36

struct rwnx_vif {
    struct list_head list;
    struct rwnx_hw *rwnx_hw;
    struct wireless_dev wdev;
    struct net_device *ndev;
    struct net_device_stats net_stats;
    struct rwnx_key key[6];
    atomic_t drv_conn_state;
    u8 drv_vif_index;           /* Identifier of the VIF in driver */
    u8 vif_index;               /* Identifier of the station in FW */
    u8 ch_index;                /* Channel context identifier */
    bool up;                    /* Indicate if associated netdev is up
                                   (i.e. Interface is created at fw level) */
    bool use_4addr;             /* Should we use 4addresses mode */
    bool is_resending;          /* Indicate if a frame is being resent on this interface */
    bool user_mpm;              /* In case of Mesh Point VIF, indicate if MPM is handled by         userspace */
    bool roc_tdls;              /* Indicate if the ROC has been called by a TDLS station */
    u8 tdls_status;             /* Status of the TDLS link */
    bool tdls_chsw_prohibited;  /* Indicate if TDLS Channel Switch is prohibited */
    bool wep_enabled;           /* 1 if WEP is enabled */
    bool wep_auth_err;          /* 1 if auth status code is not supported auth alg when WEP         enabled */
    enum nl80211_auth_type last_auth_type; /* Authentication type (algorithm) sent in the last         connection when WEP enabled */
    union
    {
        struct
        {
            struct rwnx_sta *ap; /* Pointer to the peer STA entry allocated for
                                    the AP */
            struct rwnx_sta *tdls_sta; /* Pointer to the TDLS station */
            bool external_auth;  /* Indicate if external authentication is in progress */
            u8 group_cipher_type;
            u8 paired_cipher_type;
            //connected network info start
            char ssid[33];//ssid max is 32, but this has one spare for '\0'
            int ssid_len;
            u8 bssid[ETH_ALEN];
            //connected network info end
        } sta;
        struct
        {
            u16 flags;                 /* see rwnx_ap_flags */
            struct list_head sta_list; /* List of STA connected to the AP */
            struct rwnx_bcn bcn;       /* beacon */
            u8 bcmc_index;             /* Index of the BCMC sta to use */
            #if (defined CONFIG_HE_FOR_OLD_KERNEL) || (defined                 CONFIG_VHT_FOR_OLD_KERNEL)
            u8 aic_index;
            #endif
            struct rwnx_csa *csa;

            struct list_head mpath_list; /* List of Mesh Paths used on this interface */
            struct list_head proxy_list; /* List of Proxies Information used on this interface */
            bool create_path;            /* Indicate if we are waiting for a MESH_CREATE_PATH_CFM
                                            message */
            int generation;              /* Increased each time the list of Mesh Paths is updated */
            enum nl80211_mesh_power_mode mesh_pm; /* mesh power save mode currently set                 in firmware */
            enum nl80211_mesh_power_mode next_mesh_pm; /* mesh power save mode for next                 peer */
        } ap;
        struct
        {
            struct rwnx_vif *master;   /* pointer on master interface */
            struct rwnx_sta *sta_4a;
        } ap_vlan;
    };

    u8_l key_has_add;
    u8_l is_p2p_vif;
    struct apm_probe_sta sta_probe;
};

struct rwnx_hw {
    struct rwnx_mod_params *mod_params;
    struct device *dev;
#ifdef AICWF_SDIO_SUPPORT
    struct aic_sdio_dev *sdiodev;
#endif
#ifdef AICWF_USB_SUPPORT
    struct aic_usb_dev *usbdev;
#endif
    struct wiphy *wiphy;
    struct list_head vifs;
    struct rwnx_vif *vif_table[NX_VIRT_DEV_MAX + NX_REMOTE_STA_MAX]; /* indexed with fw id */
    struct rwnx_sta sta_table[NX_REMOTE_STA_MAX + NX_VIRT_DEV_MAX];
    #ifdef CONFIG_HE_FOR_OLD_KERNEL
struct aic_sta aic_table[NX_REMOTE_STA_MAX + NX_VIRT_DEV_MAX];
    #endif
    struct rwnx_survey_info survey[SCAN_CHANNEL_MAX];
    struct cfg80211_scan_request *scan_request;
#ifdef CONFIG_SCHED_SCAN
    struct cfg80211_sched_scan_request *sched_scan_req;
#endif
    struct rwnx_chanctx chanctx_table[NX_CHAN_CTXT_CNT];
    u8 cur_chanctx;

    u8 monitor_vif; /* FW id of the monitor interface, RWNX_INVALID_VIF if no monitor vif at fw level */

    /* RoC Management */
    struct rwnx_roc_elem *roc_elem;             /* Information provided by cfg80211 in its remain on channel request */
    u32 roc_cookie_cnt;                         /* Counter used to identify RoC request sent by cfg80211 */

    struct rwnx_cmd_mgr *cmd_mgr;

    unsigned long drv_flags;
    struct rwnx_plat *plat;

    spinlock_t tx_lock;
    spinlock_t cb_lock;
    struct mutex mutex;                         /* per-device perimeter lock */

    struct tasklet_struct task;
    struct mm_version_cfm version_cfm;          /* Lower layers versions - obtained via MM_VERSION_REQ */

    u32 tcp_pacing_shift;

    /* IPC */
    struct ipc_host_env_tag *ipc_env;
#ifdef AICWF_SDIO_SUPPORT
    struct sdio_host_env_tag sdio_env;
#endif
#ifdef AICWF_USB_SUPPORT
    struct usb_host_env_tag usb_env;
#endif

    struct rwnx_ipc_elem_pool e2amsgs_pool;
    struct rwnx_ipc_elem_pool dbgmsgs_pool;
    struct rwnx_ipc_elem_pool e2aradars_pool;
    struct rwnx_ipc_elem_var pattern_elem;
    struct rwnx_ipc_dbgdump_elem dbgdump_elem;
    struct rwnx_ipc_elem_pool e2arxdesc_pool;
    struct rwnx_ipc_skb_elem *e2aunsuprxvec_elems;
    //struct rwnx_ipc_rxbuf_elems rxbuf_elems;
    struct rwnx_ipc_elem_var scan_ie;


    struct kmem_cache      *sw_txhdr_cache;

    struct rwnx_debugfs     debugfs;
    struct rwnx_stats       stats;

#ifdef CONFIG_PREALLOC_TXQ
    struct rwnx_txq *txq;
#else
    struct rwnx_txq txq[NX_NB_TXQ];
#endif
    struct rwnx_hwq hwq[NX_TXQ_CNT];

    u8 avail_idx_map;
    u8 vif_started;
    bool adding_sta;
    struct rwnx_phy_info phy;


    struct rwnx_radar radar;

    /* extended capabilities supported */
    u8 ext_capa[8];

#ifdef CONFIG_RWNX_MUMIMO_TX
    struct rwnx_mu_info mu;
#endif
    u8 is_p2p_alive;
    u8 is_p2p_connected;
    struct timer_list p2p_alive_timer;
    struct rwnx_vif *p2p_dev_vif;
    atomic_t p2p_alive_timer_count;
    bool band_5g_support;
    bool fwlog_en;

    struct work_struct apmStalossWork;
    struct workqueue_struct *apmStaloss_wq;
    u8 apm_vif_idx;
    u8 sta_mac_addr[6];
#ifdef CONFIG_SCHED_SCAN
        bool is_sched_scan;
#endif//CONFIG_SCHED_SCAN 

    struct sta_tx_flowctrl sta_flowctrl[NX_REMOTE_STA_MAX];
#if 0
    bool he_flag;
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 6, 0)
    struct mac_chan_op ap_chan;
    struct ieee80211_channel set_chan;
#endif
#ifdef CONFIG_VHT_FOR_OLD_KERNEL
    struct ieee80211_sta_vht_cap vht_cap_2G;
    struct ieee80211_sta_vht_cap vht_cap_5G;
#endif

#ifdef CONFIG_USE_WIRELESS_EXT
    bool wext_scan;
    struct completion wext_scan_com;
    struct list_head wext_scanre_list;
    char wext_essid[32];
    int support_freqs[SCAN_CHANNEL_MAX];
    int support_freqs_number;
#endif
};

rwnx_vif结构体中主要包含rwnx_hw硬件相关结构体(即mac层相关硬件结构体的描述)
和wireless_dev和网络层net_device及网络状态net_device_stats结构体。
nl80211_auth_type认证算法,sta和ap相关bssid即mesh组网描述。

rwnx_hw 则主要包含基类struct device *dev,sdio设备描述struct aic_sdio_dev *sdiodev或者
usb设备描述struct aic_usb_dev *usbdev,及无线phy设备描述struct wiphy *wiphy。
还有cfg80211扫描请求描述struct cfg80211_scan_request *scan_request,及工作任务描述
struct tasklet_struct task,如果使能CONFIG_USE_WIRELESS_EXT的话还有相关EXT的描述。
阅读(731) | 评论(0) | 转发(0) |
0

上一篇:linux设备注册

下一篇:namei.c详解

给主人留下些什么吧!~~