ath9k网卡驱动相关
因最近需要对ath9k的网卡驱动进行一些修改,但是网上资料比较少也比较零散,所以在这里整理一下并加上一些自己的理解,有助于自己的分析。
(1):ath_softc是硬件与MAC层进行交互的中间载体,很多有用的
网络参数都可以从ath_softc中得到,对于进一步的网卡驱动开发,收集网络数据等很有帮助。
定义位置:drivers/net/wireless/ath/ath9k/ath9k.h 具体定义如下:
struct ath_softc {struct ieee80211_hw *hw; //保存硬件信息struct device *dev; //当前工作的设备u32 chan_bw; // 信道带宽int chan_idx; // 信道序号int chan_is_ht; // 是否使用high_throughput模式 即绿野模式struct survey_info *cur_survey;struct survey_info survey[ATH9K_NUM_CHANNELS];struct tasklet_struct intr_tq; struct tasklet_struct bcon_tasklet; //结构体定义在 include <linux/interrupt.h> 用于中断管理struct ath_hw *sc_ah; //hw的包装结构体void __iomem *mem; //内存区域int irq;spinlock_t sc_serial_rw;spinlock_t sc_pm_lock;spinlock_t sc_pcu_lock; //进行数据读取,或者处理skb时需要的锁struct mutex mutex;struct work_struct paprd_work;struct work_struct hw_check_work;struct work_struct hw_reset_work; //执行不同工作的工作队列 以后在代码中具体解释struct completion paprd_complete;unsigned int hw_busy_count;u32 intrstatus;u32 sc_flags; /* SC_OP_* */u16 ps_flags; /* PS_* */u16 curtxpow;bool ps_enabled;bool ps_idle;short nbcnvifs;short nvifs;unsigned long ps_usecount;struct ath_config config;struct ath_rx rx;struct ath_tx tx;struct ath_beacon beacon;struct ieee80211_supported_band sbands[IEEE80211_NUM_BANDS]; //当前支持的带宽#ifdef CONFIG_MAC80211_LEDSconst char *led_default_trigger;struct list_head leds;
#endifstruct ath9k_hw_cal_data caldata;int last_rssi;#ifdef CONFIG_ATH9K_DEBUGFSstruct ath9k_debug debug;spinlock_t nodes_lock;struct list_head nodes; /* basically, stations */unsigned int tx_complete_poll_work_seen;
#endifstruct ath_beacon_config cur_beacon_conf;struct delayed_work tx_complete_work;struct delayed_work hw_pll_work;struct ath_btcoex btcoex;struct ath_mci_coex mci_coex;struct ath_descdma txsdma;struct ath_ant_comb ant_comb;u8 ant_tx, ant_rx;
};
(2): * struct ieee80211_hw - hardware information and state
*
* This structure contains the configuration and hardware
* information for an 802.11 PHY.
*
* @wiphy: This points to the &struct wiphy allocated for this
* 802.11 PHY. You must fill in the @perm_addr and @dev
* members of this structure using SET_IEEE80211_DEV()
* and SET_IEEE80211_PERM_ADDR(). Additionally, all supported
* bands (with channels, bitrates) are registered here.
*
* @conf: &struct ieee80211_conf, device configuration, don't use.
*
* @priv: pointer to private area that was allocated for driver use
* along with this structure.
*
* @flags: hardware flags, see &enum ieee80211_hw_flags.
*
* @extra_tx_headroom: headroom to reserve in each transmit skb
* for use by the driver (e.g. for transmit headers.)
*
* @extra_beacon_tailroom: tailroom to reserve in each beacon tx skb.
* Can be used by drivers to add extra IEs.
*
* @max_signal: Maximum value for signal (rssi) in RX information, used
* only when @IEEE80211_HW_SIGNAL_UNSPEC or @IEEE80211_HW_SIGNAL_DB
*
* @max_listen_interval: max listen interval in units of beacon interval
* that HW supports
*
* @queues: number of available hardware transmit queues for
* data packets. WMM/QoS requires at least four, these
* queues need to have configurable access parameters.
*
* @rate_control_algorithm: rate control algorithm for this hardware.
* If unset (NULL), the default algorithm will be used. Must be
* set before calling ieee80211_register_hw().
*
* @vif_data_size: size (in bytes) of the drv_priv data area
* within &struct ieee80211_vif.
* @sta_data_size: size (in bytes) of the drv_priv data area
* within &struct ieee80211_sta.
* @chanctx_data_size: size (in bytes) of the drv_priv data area
* within &struct ieee80211_chanctx_conf.
* @txq_data_size: size (in bytes) of the drv_priv data area
* within @struct ieee80211_txq.
*
* @max_rates: maximum number of alternate rate retry stages the hw
* can handle.
* @max_report_rates: maximum number of alternate rate retry stages
* the hw can report back.
* @max_rate_tries: maximum number of tries for each stage
*
* @max_rx_aggregation_subframes: maximum buffer size (number of
* sub-frames) to be used for A-MPDU block ack receiver
* aggregation.
* This is only relevant if the device has restrictions on the
* number of subframes, if it relies on mac80211 to do reordering
* it shouldn't be set.
*
* @max_tx_aggregation_subframes: maximum number of subframes in an
* aggregate an HT driver will transmit, used by the peer as a
* hint to size its reorder buffer.
*
* @offchannel_tx_hw_queue: HW queue ID to use for offchannel TX
* (if %IEEE80211_HW_QUEUE_CONTROL is set)
*
* @radiotap_mcs_details: lists which MCS information can the HW
* reports, by default it is set to _MCS, _GI and _BW but doesn't
* include _FMT. Use %IEEE80211_RADIOTAP_MCS_HAVE_* values, only
* adding _BW is supported today.
*
* @radiotap_vht_details: lists which VHT MCS information the HW reports,
* the default is _GI | _BANDWIDTH.
* Use the %IEEE80211_RADIOTAP_VHT_KNOWN_* values.
*
* @netdev_features: netdev features to be set in each netdev created
* from this HW. Note only HW checksum features are currently
* compatible with mac80211. Other feature bits will be rejected.
*
* @uapsd_queues: This bitmap is included in (re)association frame to indicate
* for each access category if it is uAPSD trigger-enabled and delivery-
* enabled. Use IEEE80211_WMM_IE_STA_QOSINFO_AC_* to set this bitmap.
* Each bit corresponds to different AC. Value '1' in specific bit means
* that corresponding AC is both trigger- and delivery-enabled. '0' means
* neither enabled.
*
* @uapsd_max_sp_len: maximum number of total buffered frames the WMM AP may
* deliver to a WMM STA during any Service Period triggered by the WMM STA.
* Use IEEE80211_WMM_IE_STA_QOSINFO_SP_* for correct values.
*
* @n_cipher_schemes: a size of an array of cipher schemes definitions.
* @cipher_schemes: a pointer to an array of cipher scheme definitions
* supported by HW.
*
* @txq_ac_max_pending: maximum number of frames per AC pending in all txq
* entries for a vif.
*/
ieee80211_hw主要是硬件的信息和状态
struct ieee80211_hw {struct ieee80211_conf conf;struct wiphy *wiphy;const char *rate_control_algorithm;void *priv;u32 flags;unsigned int extra_tx_headroom;unsigned int extra_beacon_tailroom;int vif_data_size;int sta_data_size;int chanctx_data_size;int txq_data_size;u16 queues;u16 max_listen_interval;s8 max_signal;u8 max_rates;u8 max_report_rates;u8 max_rate_tries;u8 max_rx_aggregation_subframes;u8 max_tx_aggregation_subframes;u8 offchannel_tx_hw_queue;u8 radiotap_mcs_details;u16 radiotap_vht_details;netdev_features_t netdev_features;u8 uapsd_queues;u8 uapsd_max_sp_len;u8 n_cipher_schemes;const struct ieee80211_cipher_scheme *cipher_schemes;int txq_ac_max_pending;<pre name="code" class="cpp">}
ath9k网卡驱动相关相关推荐
- 无线网卡的工作模式--ath9k网卡驱动开发总结(一)
最近做80211无线网络速率调整算法,有一些心得体会和经验感觉应该总结一下.希望能够坚持写完. 在ath9k的驱动中,将无线网卡的工作模式划分为五种:Ad-Hoc STATION WDS AP A ...
- Linux 网卡驱动相关——03
紧接上一篇,这里简要介绍net_device 结构和网卡驱动框架. struct net_device 是一个比sk_buff 更复杂的结构,里面包含了与TCP/IP协议栈通信的接口函数,但是自从2 ...
- 华为服务器网卡驱动安装文件,服务器网卡驱动
服务器网卡驱动 内容精选 换一换 Ubuntu服务器通过Windows操作系统上的虚拟机安装的场景下,需要在Windows操作系统上安装USB网卡驱动,即RNDIS(Remote Network Dr ...
- 华为服务器网卡驱动安装文件,服务器版网卡驱动
服务器版网卡驱动 内容精选 换一换 本文中所有未作特别说明的操作皆需在Host1和Host2同步进行,仅需在某台服务器单独进行的操作将注明Host1和Host2进行区分.本文命令中所涉及Mellano ...
- Kali网卡驱动安装及相关问题解决(2020.1)
正文开始 kali安装过程略- 目前为止2020年1月 使用用户名登录,进入ROOT模式在控制台输入指令 sudo su 1.Kali网卡驱动的安装(直接识别的请忽略此步骤) 因为我的网卡是自动识别的 ...
- 网卡驱动和队列层中的数据包接收
一.从网卡说起 这并非是一个网卡驱动分析的专门文档,只是对网卡处理数据包的流程进行一个重点的分析.这里以Intel的e100驱动为例进行分析. 大多数网卡都是一个PCI设备,PCI设备都包含了一个标准 ...
- linux 服务器 安装网卡驱动,linux下安装编译网卡驱动的方法
安装linux操作系统后发现没有网卡驱动,表现为 system → Administration → Network下Hardware列表为空. 以下为安装编译网卡驱动的过程,本人是菜鸟,以下是我从网 ...
- linux双网卡驱动配置,linux网卡驱动安装、双网卡绑定
本次课程包含RAID0/1/5/6/10/50/60配置实验(使用Dell R720服务器实验).Redhat/CentOS/ubuntu/windows操作系统安装.windows/linux网卡绑 ...
- Linux服务器网卡驱动安装及故障排除(转)
Linux服务器网卡驱动安装及故障排除(转) 转自:http://www.ccw.com.cn/server/yyjq/htm2005/20050817_15OF4.htm感谢原创作者 曹江华 Lin ...
最新文章
- 函数传参string_JavaScript 高阶函数入门浅析
- 基于OpenDDS开发发布订阅HelloMsg程序的过程(Windows)
- Mysql中SQL语句不使用索引的情况
- Solr 部分 局部字段修改 更新 删除
- IntelliJ IDEA:文件的路径本该是”\“,却变成了”¥“
- annotatedClasses和component-scan冲突吗
- 使用“Grafeas”元数据API和“Kritis”部署授权管理软件供应链
- 不同的智能门锁解决方案开锁方式
- unity天空盒渐变,Unity 3D从一个天空盒淡入另一个天空盒
- [架构之路-42]:目标系统 - 系统软件 - Linux下的网络通信-2-无线局域网WIFI原理、WIFI与3G/4G/以太网/蓝牙的协议转换
- 从不同音效材质了解游戏界面音效
- VS2010上winform打包发布、打包安装程序(超全超详细)
- 安装小企鹅游戏(企5)
- 电子计算机显示屏不亮了,手把手教你电脑显示器不亮怎么办
- 六年级下计算机教案封面,六年级下册信息技术教案21279(43页)-原创力文档
- 计算几何之 旋转卡壳 代码模板与证明
- 今日头条最新_signature
- 乐高中的第一个C语言编程,Robotc for EV3 配置及第一个小实例
- 电磁兼容——电子系统的EMC要求
- 微软输入法怎么最小化到托盘_微软推出 Windows 10X 系统模拟器,未来的双屏电脑系统长这样?...
热门文章
- 如何使用cookie信息,完成自动登录
- python汇率的转换程序_【菜鸟学Python】案例一:汇率换算
- ceph命令系列(一):ceph-deploy/ceph/rados/rbd 常用命令详解
- 基于IPSAN的存储典型备份方案
- 环形链表【手绘漫画】面试必考之双指针(LeetCode 141)
- Not registered via @EnableConfigurationProperties or marked as Spring component
- Android事件分发机制在实战开发中的应用之二
- 如何用input checkbox实现按钮开关样式?
- 注册一个私人网站至少要多少钱(注册步骤)
- activity流程撤回功能实现