Linux kernel 如何在mac80211中更改通道

Linux kernel 如何在mac80211中更改通道,linux-kernel,network-programming,linux-device-driver,wireless,Linux Kernel,Network Programming,Linux Device Driver,Wireless,我正在尝试编写一个简单的例程来更改无线设备的工作通道 到目前为止,我已经: /* These are function arguments */ struct ieee80211_local *local; struct ieee80211_sub_if_data *sdata; /* Declare a struct for the new channel */ struct cfg80211_chan_def new_channel; /* Testing with 5765MHz */

我正在尝试编写一个简单的例程来更改无线设备的工作通道

到目前为止,我已经:

/* These are function arguments */
struct ieee80211_local *local;
struct ieee80211_sub_if_data *sdata;

/* Declare a struct for the new channel */
struct cfg80211_chan_def new_channel;

/* Testing with 5765MHz */
new_channel.center_freq1 = 5765;
new_channel.center_freq2 = 0;
new_channel.chan = ieee80211_get_channel(sdata->local->hw.wiphy, 5765);
local->_oper_chandef = new_channel;

/* Reconfigure hardware */
ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_CHANNEL);
但是,由于通道配置无效,我收到了大量内核级警告,而且通道没有改变

硬件/软件规格:

  • 富士通救生艇
  • Atheros无线网卡(ath9k)
  • Linux内核3.14(更准确地说是mptcp-0.89)