-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
yaml --- r: 352168 b: refs/heads/master c: fcab189 h: refs/heads/master v: v3
- Loading branch information
Eliad Peller
authored and
Luciano Coelho
committed
Nov 27, 2012
1 parent
6ea036f
commit ab95845
Showing
12 changed files
with
205 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
--- | ||
refs/heads/master: b6acb4e00e187cb5ae8dd479958a02fe0ea97bf0 | ||
refs/heads/master: fcab189027cdd68df7f97474d1419aaa4a82130c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
wl18xx-objs = main.o acx.o tx.o io.o debugfs.o scan.o | ||
wl18xx-objs = main.o acx.o tx.o io.o debugfs.o scan.o cmd.o | ||
|
||
obj-$(CONFIG_WL18XX) += wl18xx.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
/* | ||
* This file is part of wl18xx | ||
* | ||
* Copyright (C) 2011 Texas Instruments Inc. | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License | ||
* version 2 as published by the Free Software Foundation. | ||
* | ||
* This program is distributed in the hope that it will be useful, but | ||
* WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program; if not, write to the Free Software | ||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
* 02110-1301 USA | ||
* | ||
*/ | ||
|
||
#include "../wlcore/cmd.h" | ||
#include "../wlcore/debug.h" | ||
#include "../wlcore/hw_ops.h" | ||
|
||
#include "cmd.h" | ||
|
||
int wl18xx_cmd_channel_switch(struct wl1271 *wl, | ||
struct wl12xx_vif *wlvif, | ||
struct ieee80211_channel_switch *ch_switch) | ||
{ | ||
struct wl18xx_cmd_channel_switch *cmd; | ||
u32 supported_rates; | ||
int ret; | ||
|
||
wl1271_debug(DEBUG_ACX, "cmd channel switch"); | ||
|
||
cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); | ||
if (!cmd) { | ||
ret = -ENOMEM; | ||
goto out; | ||
} | ||
|
||
cmd->role_id = wlvif->role_id; | ||
cmd->channel = ch_switch->channel->hw_value; | ||
cmd->switch_time = ch_switch->count; | ||
cmd->stop_tx = ch_switch->block_tx; | ||
|
||
switch (ch_switch->channel->band) { | ||
case IEEE80211_BAND_2GHZ: | ||
cmd->band = WLCORE_BAND_2_4GHZ; | ||
break; | ||
case IEEE80211_BAND_5GHZ: | ||
cmd->band = WLCORE_BAND_5GHZ; | ||
break; | ||
default: | ||
wl1271_error("invalid channel switch band: %d", | ||
ch_switch->channel->band); | ||
ret = -EINVAL; | ||
goto out_free; | ||
} | ||
|
||
supported_rates = CONF_TX_ENABLED_RATES | CONF_TX_MCS_RATES | | ||
wlcore_hw_sta_get_ap_rate_mask(wl, wlvif); | ||
if (wlvif->p2p) | ||
supported_rates &= ~CONF_TX_CCK_RATES; | ||
cmd->local_supported_rates = cpu_to_le32(supported_rates); | ||
cmd->channel_type = wlvif->channel_type; | ||
|
||
ret = wl1271_cmd_send(wl, CMD_CHANNEL_SWITCH, cmd, sizeof(*cmd), 0); | ||
if (ret < 0) { | ||
wl1271_error("failed to send channel switch command"); | ||
goto out_free; | ||
} | ||
|
||
out_free: | ||
kfree(cmd); | ||
out: | ||
return ret; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* This file is part of wl18xx | ||
* | ||
* Copyright (C) 2011 Texas Instruments. All rights reserved. | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License | ||
* version 2 as published by the Free Software Foundation. | ||
* | ||
* This program is distributed in the hope that it will be useful, but | ||
* WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program; if not, write to the Free Software | ||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
* 02110-1301 USA | ||
* | ||
*/ | ||
|
||
#ifndef __WL18XX_CMD_H__ | ||
#define __WL18XX_CMD_H__ | ||
|
||
#include "../wlcore/wlcore.h" | ||
#include "../wlcore/acx.h" | ||
|
||
struct wl18xx_cmd_channel_switch { | ||
struct wl1271_cmd_header header; | ||
|
||
u8 role_id; | ||
|
||
/* The new serving channel */ | ||
u8 channel; | ||
/* Relative time of the serving channel switch in TBTT units */ | ||
u8 switch_time; | ||
/* Stop the role TX, should expect it after radar detection */ | ||
u8 stop_tx; | ||
|
||
__le32 local_supported_rates; | ||
|
||
u8 channel_type; | ||
u8 band; | ||
|
||
u8 padding[2]; | ||
} __packed; | ||
|
||
int wl18xx_cmd_channel_switch(struct wl1271 *wl, | ||
struct wl12xx_vif *wlvif, | ||
struct ieee80211_channel_switch *ch_switch); | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters