我正在尝试编写一个简单的例程来改变无线设备的操作频道。
到目前为止,我有:
/* 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);
但是,由于通道配置无效,我收到了大量的内核级警告,而且频道没有变化。
硬件/软件规格: