cfg80211 subsystem中的wiphy

本文介绍了无线网络设备驱动在Linux内核中使用cfg80211子系统时,如何通过wiphy结构体进行注册。wiphy包含了设备的MAC地址、多MAC地址支持、接口类型等关键信息,并提供了与之相关的操作函数,如创建、注册、注销wiphy等。
摘要由CSDN通过智能技术生成

无线网络设备驱动使用cfg80211需要硬件设备在cfg80211中实现注册。实现注册就要定义一系列的硬件功能描述的结构体。
每个设备的基础性结构体是wiphy,设备连接到系统时,都要使用。每个wiphy有0个,1个或者许多个虚拟接口相关联。

struct wiphy定义在内核include/net/cfg80211.h中

struct wiphy {
    /* assign these fields before you register the wiphy */

    /* permanent MAC address(es) */
    u8 perm_addr[ETH_ALEN];
    u8 addr_mask[ETH_ALEN];

    struct mac_address *addresses;

    const struct ieee80211_txrx_stypes *mgmt_stypes;

    const struct ieee80211_iface_combination *iface_combinations;
    int n_iface_combinations;
    u16 software_iftypes;

    u16 n_addresses;

    /* Supported interface modes, OR together BIT(NL80211_IFTYPE_...) */
    u16 interface_modes;

    u16 max_acl_mac_addrs;

    u32 flags, regulatory_flags, features;
    u8 ext_features[DIV_ROUND_UP(NUM_NL80211_EXT_FEATURES, 8)];

    u32 ap_sme_capa;

    enum cfg80211_signal_type signal_type;

    int bss_priv_size;
    u8 max_scan_ssids;
    u8 max_sched_scan_ssids;
    u8 max_match_sets;
    u16 max_scan_ie_len;
    u16 max_sched_scan_ie_len;
    u32 max_sched_scan_plans;
    u32 max_sched_scan_plan_interval;
    u32 max_sched_scan_plan_iterations;

    int n_cipher_suites;
    const u32 *cipher_suites;

    u8 retry_short;
    u8 retry_long;
    u32 frag_threshold;
    u32 rts_threshold;
    u8 coverage_class;

    char fw_version[ETHTOOL_FWVERS_LEN];
    u32 hw_version;

#ifdef CONFIG_PM
    const struct wiphy_wowlan_support *wowlan;
    struct cfg80211_wowlan *wowlan_config;
#endif

    u16 max_remain_on_channel_duration;

    u8 max_num_pmkids;

    u32 available_antennas_tx;
    u32 available_antennas_rx;

    /*
     * Bitmap of supported protocols for probe response offloading
     * see &enum nl80211_probe_resp_offload_support_attr. Only valid
     * when the wiphy flag @WIPHY_FLAG_AP_PROBE_RESP_OFFLOAD is set.
     */
    u32 probe_resp_offload;

    const u8 *extended_capabilities, *extended_capabilities_mask;
    u8 extended_capabilities_len;

    /* If multiple wiphys are registered and you're handed e.g.
     * a regular netdev with assigned ieee80211_ptr, you won't
     * know whether it points to a wiphy your driver has registered
     * or not. Assign this to something global to your driver to
     * help determine whether you own this wiphy or not. */
    const void *privid;

    struct ieee80211_supported_band *bands[NUM_NL80211_BANDS];

    /* Lets us get back the wiphy on the callback */
    void (*reg_notifier)(struct wiphy *wiphy,
                 struct regulatory_request *request);

    /* fields below are read-only, assigned by cfg80211 */

    const struct ieee80211_regdomain __rcu *regd;

    /* the item in /sys/class/ieee80211/ points to this,
     * you need use set_wiphy_dev() (see below) */
   
  • 3
    点赞
  • 16
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值