rwnx无线驱动主结构体分析-凯发app官方网站

凯发app官方网站-凯发k8官网下载客户端中心 | | 凯发app官方网站-凯发k8官网下载客户端中心
  • 博客访问: 263855
  • 博文数量: 90
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 665
  • 用 户 组: 普通用户
  • 注册时间: 2018-10-15 14:13
个人简介

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

文章分类

全部博文(90)

文章存档

2024年(4)

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的描述。
阅读(626) | 评论(0) | 转发(0) |
0

上一篇:linux设备注册

下一篇:namei.c详解

给主人留下些什么吧!~~
")); function link(t){ var href= $(t).attr('href'); href ="?url=" encodeuricomponent(location.href); $(t).attr('href',href); //setcookie("returnouturl", location.href, 60, "/"); }
网站地图