如何在mac80211中更改频道

时间:2015-05-21 14:55:21

标签: 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 */
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);

但是,由于通道配置无效,我收到了大量的内核级警告,而且频道没有变化。

硬件/软件规格:

  • 富士通Lifebook S
  • Atheros无线网卡(ath9k)
  • Linux内核3.14(mptcp-0.89,更准确)

0 个答案:

没有答案