diff options
author | Sebastian Smolorz <Sebastian.Smolorz@gmx.de> | 2010-06-22 10:53:37 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-06-24 15:42:32 -0400 |
commit | 41b4b289adaaf53e563a2cde17c45c492608edb0 (patch) | |
tree | aea5fd7d7c1894df0963606763f6cefe1c1b62d0 /drivers/net/wireless/at76c50x-usb.c | |
parent | c937019761a758f2749b1f3a032b7a91fb044753 (diff) |
at76c50x-usb: Move function at76_join() several lines up
This patch does a simple code move of at76_join() so that
at76_mac80211_tx() follows at76_join() in the driver's source file.
This is a preparatory patch for the following patch where we need
to call at76_join() from at76_mac80211_tx() in order to
authenticate successfully with a bssid.
Signed-off-by: Sebastian Smolorz <sesmo@gmx.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/at76c50x-usb.c')
-rw-r--r-- | drivers/net/wireless/at76c50x-usb.c | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/drivers/net/wireless/at76c50x-usb.c b/drivers/net/wireless/at76c50x-usb.c index 8a2d4afc74f8..cb3d4b70bcbc 100644 --- a/drivers/net/wireless/at76c50x-usb.c +++ b/drivers/net/wireless/at76c50x-usb.c | |||
@@ -1649,6 +1649,42 @@ exit: | |||
1649 | return NULL; | 1649 | return NULL; |
1650 | } | 1650 | } |
1651 | 1651 | ||
1652 | static int at76_join(struct at76_priv *priv) | ||
1653 | { | ||
1654 | struct at76_req_join join; | ||
1655 | int ret; | ||
1656 | |||
1657 | memset(&join, 0, sizeof(struct at76_req_join)); | ||
1658 | memcpy(join.essid, priv->essid, priv->essid_size); | ||
1659 | join.essid_size = priv->essid_size; | ||
1660 | memcpy(join.bssid, priv->bssid, ETH_ALEN); | ||
1661 | join.bss_type = INFRASTRUCTURE_MODE; | ||
1662 | join.channel = priv->channel; | ||
1663 | join.timeout = cpu_to_le16(2000); | ||
1664 | |||
1665 | at76_dbg(DBG_MAC80211, "%s: sending CMD_JOIN", __func__); | ||
1666 | ret = at76_set_card_command(priv->udev, CMD_JOIN, &join, | ||
1667 | sizeof(struct at76_req_join)); | ||
1668 | |||
1669 | if (ret < 0) { | ||
1670 | printk(KERN_ERR "%s: at76_set_card_command failed: %d\n", | ||
1671 | wiphy_name(priv->hw->wiphy), ret); | ||
1672 | return 0; | ||
1673 | } | ||
1674 | |||
1675 | ret = at76_wait_completion(priv, CMD_JOIN); | ||
1676 | at76_dbg(DBG_MAC80211, "%s: CMD_JOIN returned: 0x%02x", __func__, ret); | ||
1677 | if (ret != CMD_STATUS_COMPLETE) { | ||
1678 | printk(KERN_ERR "%s: at76_wait_completion failed: %d\n", | ||
1679 | wiphy_name(priv->hw->wiphy), ret); | ||
1680 | return 0; | ||
1681 | } | ||
1682 | |||
1683 | at76_set_pm_mode(priv); | ||
1684 | |||
1685 | return 0; | ||
1686 | } | ||
1687 | |||
1652 | static void at76_mac80211_tx_callback(struct urb *urb) | 1688 | static void at76_mac80211_tx_callback(struct urb *urb) |
1653 | { | 1689 | { |
1654 | struct at76_priv *priv = urb->context; | 1690 | struct at76_priv *priv = urb->context; |
@@ -1818,42 +1854,6 @@ static void at76_remove_interface(struct ieee80211_hw *hw, | |||
1818 | at76_dbg(DBG_MAC80211, "%s()", __func__); | 1854 | at76_dbg(DBG_MAC80211, "%s()", __func__); |
1819 | } | 1855 | } |
1820 | 1856 | ||
1821 | static int at76_join(struct at76_priv *priv) | ||
1822 | { | ||
1823 | struct at76_req_join join; | ||
1824 | int ret; | ||
1825 | |||
1826 | memset(&join, 0, sizeof(struct at76_req_join)); | ||
1827 | memcpy(join.essid, priv->essid, priv->essid_size); | ||
1828 | join.essid_size = priv->essid_size; | ||
1829 | memcpy(join.bssid, priv->bssid, ETH_ALEN); | ||
1830 | join.bss_type = INFRASTRUCTURE_MODE; | ||
1831 | join.channel = priv->channel; | ||
1832 | join.timeout = cpu_to_le16(2000); | ||
1833 | |||
1834 | at76_dbg(DBG_MAC80211, "%s: sending CMD_JOIN", __func__); | ||
1835 | ret = at76_set_card_command(priv->udev, CMD_JOIN, &join, | ||
1836 | sizeof(struct at76_req_join)); | ||
1837 | |||
1838 | if (ret < 0) { | ||
1839 | printk(KERN_ERR "%s: at76_set_card_command failed: %d\n", | ||
1840 | wiphy_name(priv->hw->wiphy), ret); | ||
1841 | return 0; | ||
1842 | } | ||
1843 | |||
1844 | ret = at76_wait_completion(priv, CMD_JOIN); | ||
1845 | at76_dbg(DBG_MAC80211, "%s: CMD_JOIN returned: 0x%02x", __func__, ret); | ||
1846 | if (ret != CMD_STATUS_COMPLETE) { | ||
1847 | printk(KERN_ERR "%s: at76_wait_completion failed: %d\n", | ||
1848 | wiphy_name(priv->hw->wiphy), ret); | ||
1849 | return 0; | ||
1850 | } | ||
1851 | |||
1852 | at76_set_pm_mode(priv); | ||
1853 | |||
1854 | return 0; | ||
1855 | } | ||
1856 | |||
1857 | static void at76_dwork_hw_scan(struct work_struct *work) | 1857 | static void at76_dwork_hw_scan(struct work_struct *work) |
1858 | { | 1858 | { |
1859 | struct at76_priv *priv = container_of(work, struct at76_priv, | 1859 | struct at76_priv *priv = container_of(work, struct at76_priv, |