diff options
author | Shahar Levi <shahar_levi@ti.com> | 2011-09-08 06:01:33 -0400 |
---|---|---|
committer | Luciano Coelho <coelho@ti.com> | 2011-10-07 01:32:27 -0400 |
commit | 6d158ff38d8c99dc1bee775a66451168316692f4 (patch) | |
tree | 500f64f4e4e4bacda3fc62b571e10dab52aa10e6 /drivers/net/wireless/wl12xx/cmd.c | |
parent | c9e79a4714493df6508d8346195ea30fb69b7783 (diff) |
wl12xx: Add support for HW channel switch
The wl12xx FW supports HW channel switch. If we don't use it,
sometimes the firmware gets confused when recalibrating to the new
channel, causing RX problems. This commit adds HW channel switch
support by implementing the channell_switch op.
Signed-off-by: Shahar Levi <shahar_levi@ti.com>
[added one comment, remove the tx_flush and rephrased the commit message]
Signed-off-by: Luciano Coelho <coelho@ti.com>
Diffstat (limited to 'drivers/net/wireless/wl12xx/cmd.c')
-rw-r--r-- | drivers/net/wireless/wl12xx/cmd.c | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/drivers/net/wireless/wl12xx/cmd.c b/drivers/net/wireless/wl12xx/cmd.c index 287fe95ecb40..8c963a6bb0a5 100644 --- a/drivers/net/wireless/wl12xx/cmd.c +++ b/drivers/net/wireless/wl12xx/cmd.c | |||
@@ -1700,3 +1700,61 @@ int wl12xx_croc(struct wl1271 *wl, u8 role_id) | |||
1700 | out: | 1700 | out: |
1701 | return ret; | 1701 | return ret; |
1702 | } | 1702 | } |
1703 | |||
1704 | int wl12xx_cmd_channel_switch(struct wl1271 *wl, | ||
1705 | struct ieee80211_channel_switch *ch_switch) | ||
1706 | { | ||
1707 | struct wl12xx_cmd_channel_switch *cmd; | ||
1708 | int ret; | ||
1709 | |||
1710 | wl1271_debug(DEBUG_ACX, "cmd channel switch"); | ||
1711 | |||
1712 | cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); | ||
1713 | if (!cmd) { | ||
1714 | ret = -ENOMEM; | ||
1715 | goto out; | ||
1716 | } | ||
1717 | |||
1718 | cmd->channel = ch_switch->channel->hw_value; | ||
1719 | cmd->switch_time = ch_switch->count; | ||
1720 | cmd->tx_suspend = ch_switch->block_tx; | ||
1721 | cmd->flush = 0; /* this value is ignored by the FW */ | ||
1722 | |||
1723 | ret = wl1271_cmd_send(wl, CMD_CHANNEL_SWITCH, cmd, sizeof(*cmd), 0); | ||
1724 | if (ret < 0) { | ||
1725 | wl1271_error("failed to send channel switch command"); | ||
1726 | goto out_free; | ||
1727 | } | ||
1728 | |||
1729 | out_free: | ||
1730 | kfree(cmd); | ||
1731 | |||
1732 | out: | ||
1733 | return ret; | ||
1734 | } | ||
1735 | |||
1736 | int wl12xx_cmd_stop_channel_switch(struct wl1271 *wl) | ||
1737 | { | ||
1738 | struct wl12xx_cmd_stop_channel_switch *cmd; | ||
1739 | int ret; | ||
1740 | |||
1741 | wl1271_debug(DEBUG_ACX, "cmd stop channel switch"); | ||
1742 | |||
1743 | cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); | ||
1744 | if (!cmd) { | ||
1745 | ret = -ENOMEM; | ||
1746 | goto out; | ||
1747 | } | ||
1748 | |||
1749 | ret = wl1271_cmd_send(wl, CMD_STOP_CHANNEL_SWICTH, cmd, sizeof(*cmd), 0); | ||
1750 | if (ret < 0) { | ||
1751 | wl1271_error("failed to stop channel switch command"); | ||
1752 | goto out_free; | ||
1753 | } | ||
1754 | |||
1755 | out_free: | ||
1756 | kfree(cmd); | ||
1757 | |||
1758 | out: | ||
1759 | return ret; | ||
1760 | } | ||