Skip to content

Commit

Permalink
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/gi…
Browse files Browse the repository at this point in the history
…t/linville/wireless-next-2.6

Conflicts:
	drivers/net/wireless/libertas/host.h
  • Loading branch information
David S. Miller committed Jul 2, 2010
2 parents ea812ca + 88c1f4f commit 05318bc
Show file tree
Hide file tree
Showing 111 changed files with 3,635 additions and 7,662 deletions.
108 changes: 72 additions & 36 deletions drivers/net/wireless/at76c50x-usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* Copyright (c) 2004 Balint Seeber <n0_5p4m_p13453@hotmail.com>
* Copyright (c) 2007 Guido Guenther <agx@sigxcpu.org>
* Copyright (c) 2007 Kalle Valo <kalle.valo@iki.fi>
* Copyright (c) 2010 Sebastian Smolorz <sesmo@gmx.net>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
Expand Down Expand Up @@ -1649,6 +1650,58 @@ static struct fwentry *at76_load_firmware(struct usb_device *udev,
return NULL;
}

static int at76_join(struct at76_priv *priv)
{
struct at76_req_join join;
int ret;

memset(&join, 0, sizeof(struct at76_req_join));
memcpy(join.essid, priv->essid, priv->essid_size);
join.essid_size = priv->essid_size;
memcpy(join.bssid, priv->bssid, ETH_ALEN);
join.bss_type = INFRASTRUCTURE_MODE;
join.channel = priv->channel;
join.timeout = cpu_to_le16(2000);

at76_dbg(DBG_MAC80211, "%s: sending CMD_JOIN", __func__);
ret = at76_set_card_command(priv->udev, CMD_JOIN, &join,
sizeof(struct at76_req_join));

if (ret < 0) {
printk(KERN_ERR "%s: at76_set_card_command failed: %d\n",
wiphy_name(priv->hw->wiphy), ret);
return 0;
}

ret = at76_wait_completion(priv, CMD_JOIN);
at76_dbg(DBG_MAC80211, "%s: CMD_JOIN returned: 0x%02x", __func__, ret);
if (ret != CMD_STATUS_COMPLETE) {
printk(KERN_ERR "%s: at76_wait_completion failed: %d\n",
wiphy_name(priv->hw->wiphy), ret);
return 0;
}

at76_set_pm_mode(priv);

return 0;
}

static void at76_work_join_bssid(struct work_struct *work)
{
struct at76_priv *priv = container_of(work, struct at76_priv,
work_join_bssid);

if (priv->device_unplugged)
return;

mutex_lock(&priv->mtx);

if (is_valid_ether_addr(priv->bssid))
at76_join(priv);

mutex_unlock(&priv->mtx);
}

static void at76_mac80211_tx_callback(struct urb *urb)
{
struct at76_priv *priv = urb->context;
Expand Down Expand Up @@ -1686,6 +1739,7 @@ static int at76_mac80211_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
struct at76_priv *priv = hw->priv;
struct at76_tx_buffer *tx_buffer = priv->bulk_out_buffer;
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)skb->data;
int padding, submit_len, ret;

at76_dbg(DBG_MAC80211, "%s()", __func__);
Expand All @@ -1696,6 +1750,21 @@ static int at76_mac80211_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
return NETDEV_TX_BUSY;
}

/* The following code lines are important when the device is going to
* authenticate with a new bssid. The driver must send CMD_JOIN before
* an authentication frame is transmitted. For this to succeed, the
* correct bssid of the AP must be known. As mac80211 does not inform
* drivers about the bssid prior to the authentication process the
* following workaround is necessary. If the TX frame is an
* authentication frame extract the bssid and send the CMD_JOIN. */
if (mgmt->frame_control & cpu_to_le16(IEEE80211_STYPE_AUTH)) {
if (compare_ether_addr(priv->bssid, mgmt->bssid)) {
memcpy(priv->bssid, mgmt->bssid, ETH_ALEN);
ieee80211_queue_work(hw, &priv->work_join_bssid);
return NETDEV_TX_BUSY;
}
}

ieee80211_stop_queues(hw);

at76_ledtrig_tx_activity(); /* tell ledtrigger we send a packet */
Expand Down Expand Up @@ -1770,6 +1839,7 @@ static void at76_mac80211_stop(struct ieee80211_hw *hw)
at76_dbg(DBG_MAC80211, "%s()", __func__);

cancel_delayed_work(&priv->dwork_hw_scan);
cancel_work_sync(&priv->work_join_bssid);
cancel_work_sync(&priv->work_set_promisc);

mutex_lock(&priv->mtx);
Expand Down Expand Up @@ -1818,42 +1888,6 @@ static void at76_remove_interface(struct ieee80211_hw *hw,
at76_dbg(DBG_MAC80211, "%s()", __func__);
}

static int at76_join(struct at76_priv *priv)
{
struct at76_req_join join;
int ret;

memset(&join, 0, sizeof(struct at76_req_join));
memcpy(join.essid, priv->essid, priv->essid_size);
join.essid_size = priv->essid_size;
memcpy(join.bssid, priv->bssid, ETH_ALEN);
join.bss_type = INFRASTRUCTURE_MODE;
join.channel = priv->channel;
join.timeout = cpu_to_le16(2000);

at76_dbg(DBG_MAC80211, "%s: sending CMD_JOIN", __func__);
ret = at76_set_card_command(priv->udev, CMD_JOIN, &join,
sizeof(struct at76_req_join));

if (ret < 0) {
printk(KERN_ERR "%s: at76_set_card_command failed: %d\n",
wiphy_name(priv->hw->wiphy), ret);
return 0;
}

ret = at76_wait_completion(priv, CMD_JOIN);
at76_dbg(DBG_MAC80211, "%s: CMD_JOIN returned: 0x%02x", __func__, ret);
if (ret != CMD_STATUS_COMPLETE) {
printk(KERN_ERR "%s: at76_wait_completion failed: %d\n",
wiphy_name(priv->hw->wiphy), ret);
return 0;
}

at76_set_pm_mode(priv);

return 0;
}

static void at76_dwork_hw_scan(struct work_struct *work)
{
struct at76_priv *priv = container_of(work, struct at76_priv,
Expand Down Expand Up @@ -2107,6 +2141,7 @@ static struct at76_priv *at76_alloc_new_device(struct usb_device *udev)
mutex_init(&priv->mtx);
INIT_WORK(&priv->work_set_promisc, at76_work_set_promisc);
INIT_WORK(&priv->work_submit_rx, at76_work_submit_rx);
INIT_WORK(&priv->work_join_bssid, at76_work_join_bssid);
INIT_DELAYED_WORK(&priv->dwork_hw_scan, at76_dwork_hw_scan);

tasklet_init(&priv->rx_tasklet, at76_rx_tasklet, 0);
Expand Down Expand Up @@ -2508,5 +2543,6 @@ MODULE_AUTHOR("Balint Seeber <n0_5p4m_p13453@hotmail.com>");
MODULE_AUTHOR("Pavel Roskin <proski@gnu.org>");
MODULE_AUTHOR("Guido Guenther <agx@sigxcpu.org>");
MODULE_AUTHOR("Kalle Valo <kalle.valo@iki.fi>");
MODULE_AUTHOR("Sebastian Smolorz <sesmo@gmx.net>");
MODULE_DESCRIPTION(DRIVER_DESC);
MODULE_LICENSE("GPL");
1 change: 1 addition & 0 deletions drivers/net/wireless/at76c50x-usb.h
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,7 @@ struct at76_priv {
/* work queues */
struct work_struct work_set_promisc;
struct work_struct work_submit_rx;
struct work_struct work_join_bssid;
struct delayed_work dwork_hw_scan;

struct tasklet_struct rx_tasklet;
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/ath/ath5k/phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -1768,7 +1768,7 @@ ath5k_hw_set_fast_div(struct ath5k_hw *ah, u8 ee_mode, bool enable)

if (enable) {
AR5K_REG_WRITE_BITS(ah, AR5K_PHY_RESTART,
AR5K_PHY_RESTART_DIV_GC, 1);
AR5K_PHY_RESTART_DIV_GC, 4);

AR5K_REG_ENABLE_BITS(ah, AR5K_PHY_FAST_ANT_DIV,
AR5K_PHY_FAST_ANT_DIV_EN);
Expand Down
20 changes: 20 additions & 0 deletions drivers/net/wireless/ath/ath9k/ar9003_hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,26 @@ static void ar9003_hw_configpcipowersave(struct ath_hw *ah,
/* Several PCIe massages to ensure proper behaviour */
if (ah->config.pcie_waen)
REG_WRITE(ah, AR_WA, ah->config.pcie_waen);
else
REG_WRITE(ah, AR_WA, ah->WARegVal);
}

/*
* Configire PCIE after Ini init. SERDES values now come from ini file
* This enables PCIe low power mode.
*/
if (ah->config.pcieSerDesWrite) {
unsigned int i;
struct ar5416IniArray *array;

array = power_off ? &ah->iniPcieSerdes :
&ah->iniPcieSerdesLowPower;

for (i = 0; i < array->ia_rows; i++) {
REG_WRITE(ah,
INI_RA(array, i, 0),
INI_RA(array, i, 1));
}
}
}

Expand Down
6 changes: 5 additions & 1 deletion drivers/net/wireless/ath/ath9k/ath9k.h
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ struct ath_buf_state {
int bfs_retries;
u8 bf_type;
u8 bfs_paprd;
unsigned long bfs_paprd_timestamp;
u32 bfs_keyix;
enum ath9k_key_type bfs_keytype;
};
Expand Down Expand Up @@ -425,6 +426,8 @@ int ath_beaconq_config(struct ath_softc *sc);
#define ATH_LONG_CALINTERVAL 30000 /* 30 seconds */
#define ATH_RESTART_CALINTERVAL 1200000 /* 20 minutes */

#define ATH_PAPRD_TIMEOUT 100 /* msecs */

void ath_paprd_calibrate(struct work_struct *work);
void ath_ani_calibrate(unsigned long data);

Expand Down Expand Up @@ -516,6 +519,7 @@ void ath_deinit_leds(struct ath_softc *sc);
#define SC_OP_TSF_RESET BIT(11)
#define SC_OP_BT_PRIORITY_DETECTED BIT(12)
#define SC_OP_BT_SCAN BIT(13)
#define SC_OP_ANI_RUN BIT(14)

/* Powersave flags */
#define PS_WAIT_FOR_BEACON BIT(0)
Expand Down Expand Up @@ -559,7 +563,6 @@ struct ath_softc {
struct mutex mutex;
struct work_struct paprd_work;
struct completion paprd_complete;
int paprd_txok;

u32 intrstatus;
u32 sc_flags; /* SC_OP_* */
Expand Down Expand Up @@ -628,6 +631,7 @@ static inline void ath_read_cachesize(struct ath_common *common, int *csz)

extern struct ieee80211_ops ath9k_ops;
extern int modparam_nohwcrypt;
extern int led_blink;

irqreturn_t ath_isr(int irq, void *dev);
int ath9k_init_device(u16 devid, struct ath_softc *sc, u16 subsysid,
Expand Down
9 changes: 6 additions & 3 deletions drivers/net/wireless/ath/ath9k/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ static void ath_led_brightness(struct led_classdev *led_cdev,
case LED_FULL:
if (led->led_type == ATH_LED_ASSOC) {
sc->sc_flags |= SC_OP_LED_ASSOCIATED;
ieee80211_queue_delayed_work(sc->hw,
if (led_blink)
ieee80211_queue_delayed_work(sc->hw,
&sc->ath_led_blink_work, 0);
} else if (led->led_type == ATH_LED_RADIO) {
ath9k_hw_set_gpio(sc->sc_ah, sc->sc_ah->led_pin, 0);
Expand Down Expand Up @@ -143,7 +144,8 @@ void ath_init_leds(struct ath_softc *sc)
/* LED off, active low */
ath9k_hw_set_gpio(sc->sc_ah, sc->sc_ah->led_pin, 1);

INIT_DELAYED_WORK(&sc->ath_led_blink_work, ath_led_blink_work);
if (led_blink)
INIT_DELAYED_WORK(&sc->ath_led_blink_work, ath_led_blink_work);

trigger = ieee80211_get_radio_led_name(sc->hw);
snprintf(sc->radio_led.name, sizeof(sc->radio_led.name),
Expand Down Expand Up @@ -180,7 +182,8 @@ void ath_init_leds(struct ath_softc *sc)
return;

fail:
cancel_delayed_work_sync(&sc->ath_led_blink_work);
if (led_blink)
cancel_delayed_work_sync(&sc->ath_led_blink_work);
ath_deinit_leds(sc);
}

Expand Down
33 changes: 24 additions & 9 deletions drivers/net/wireless/ath/ath9k/hif_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,27 @@

#include "htc.h"

/* identify firmware images */
#define FIRMWARE_AR7010 "ar7010.fw"
#define FIRMWARE_AR7010_1_1 "ar7010_1_1.fw"
#define FIRMWARE_AR9271 "ar9271.fw"

MODULE_FIRMWARE(FIRMWARE_AR7010);
MODULE_FIRMWARE(FIRMWARE_AR7010_1_1);
MODULE_FIRMWARE(FIRMWARE_AR9271);

static struct usb_device_id ath9k_hif_usb_ids[] = {
{ USB_DEVICE(0x0cf3, 0x9271) },
{ USB_DEVICE(0x0cf3, 0x1006) },
{ USB_DEVICE(0x0cf3, 0x7010) },
{ USB_DEVICE(0x0cf3, 0x9271) }, /* Atheros */
{ USB_DEVICE(0x0cf3, 0x1006) }, /* Atheros */
{ USB_DEVICE(0x0cf3, 0x7010) }, /* Atheros */
{ USB_DEVICE(0x0cf3, 0x7015) }, /* Atheros */
{ USB_DEVICE(0x0846, 0x9030) }, /* Netgear N150 */
{ USB_DEVICE(0x0846, 0x9018) }, /* Netgear WNDA3200 */
{ USB_DEVICE(0x07D1, 0x3A10) }, /* Dlink Wireless 150 */
{ USB_DEVICE(0x13D3, 0x3327) }, /* Azurewave */
{ USB_DEVICE(0x13D3, 0x3328) }, /* Azurewave */
{ USB_DEVICE(0x04CA, 0x4605) }, /* Liteon */
{ USB_DEVICE(0x083A, 0xA704) }, /* SMC Networks */
{ },
};

Expand Down Expand Up @@ -879,17 +896,15 @@ static int ath9k_hif_usb_probe(struct usb_interface *interface,
/* Find out which firmware to load */

switch(hif_dev->device_id) {
case 0x9271:
case 0x1006:
hif_dev->fw_name = "ar9271.fw";
break;
case 0x7010:
case 0x9018:
if (le16_to_cpu(udev->descriptor.bcdDevice) == 0x0202)
hif_dev->fw_name = "ar7010_1_1.fw";
hif_dev->fw_name = FIRMWARE_AR7010_1_1;
else
hif_dev->fw_name = "ar7010.fw";
hif_dev->fw_name = FIRMWARE_AR7010;
break;
default:
hif_dev->fw_name = FIRMWARE_AR9271;
break;
}

Expand Down
1 change: 1 addition & 0 deletions drivers/net/wireless/ath/ath9k/htc.h
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ struct ath9k_debug {
#define ATH_LED_PIN_DEF 1
#define ATH_LED_PIN_9287 8
#define ATH_LED_PIN_9271 15
#define ATH_LED_PIN_7010 12
#define ATH_LED_ON_DURATION_IDLE 350 /* in msecs */
#define ATH_LED_OFF_DURATION_IDLE 250 /* in msecs */

Expand Down
9 changes: 2 additions & 7 deletions drivers/net/wireless/ath/ath9k/htc_drv_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,17 +244,12 @@ static int ath9k_init_htc_services(struct ath9k_htc_priv *priv, u16 devid)
*/

switch(devid) {
case 0x9271:
case 0x1006:
priv->htc->credits = 33;
break;
case 0x7010:
case 0x9018:
priv->htc->credits = 45;
break;
default:
dev_err(priv->dev, "ath9k_htc: Unsupported device id: 0x%x\n",
devid);
goto err;
priv->htc->credits = 33;
}

ret = htc_init(priv->htc);
Expand Down
2 changes: 2 additions & 0 deletions drivers/net/wireless/ath/ath9k/htc_drv_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -931,6 +931,8 @@ void ath9k_init_leds(struct ath9k_htc_priv *priv)
priv->ah->led_pin = ATH_LED_PIN_9287;
else if (AR_SREV_9271(priv->ah))
priv->ah->led_pin = ATH_LED_PIN_9271;
else if (AR_DEVID_7010(priv->ah))
priv->ah->led_pin = ATH_LED_PIN_7010;
else
priv->ah->led_pin = ATH_LED_PIN_DEF;

Expand Down
Loading

0 comments on commit 05318bc

Please sign in to comment.