Skip to content

Commit 41b4b28

Browse files
smolorzlinvjw
authored andcommitted
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>
1 parent c937019 commit 41b4b28

1 file changed

Lines changed: 36 additions & 36 deletions

File tree

‎drivers/net/wireless/at76c50x-usb.c‎

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1649,6 +1649,42 @@ static struct fwentry *at76_load_firmware(struct usb_device *udev,
16491649
return NULL;
16501650
}
16511651

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+
16521688
static void at76_mac80211_tx_callback(struct urb *urb)
16531689
{
16541690
struct at76_priv *priv = urb->context;
@@ -1818,42 +1854,6 @@ static void at76_remove_interface(struct ieee80211_hw *hw,
18181854
at76_dbg(DBG_MAC80211, "%s()", __func__);
18191855
}
18201856

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-
18571857
static void at76_dwork_hw_scan(struct work_struct *work)
18581858
{
18591859
struct at76_priv *priv = container_of(work, struct at76_priv,

0 commit comments

Comments
 (0)