Skip to content

Commit

Permalink
Merge branch 'no-iwlwifi' of git://git.kernel.org/pub/scm/linux/kerne…
Browse files Browse the repository at this point in the history
…l/git/linville/wireless-2.6
  • Loading branch information
David S. Miller committed Aug 27, 2008
2 parents df69471 + 576fdea commit 6c36810
Show file tree
Hide file tree
Showing 8 changed files with 80 additions and 81 deletions.
23 changes: 17 additions & 6 deletions drivers/net/wireless/ath5k/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ static inline void ath5k_txbuf_free(struct ath5k_softc *sc,
return;
pci_unmap_single(sc->pdev, bf->skbaddr, bf->skb->len,
PCI_DMA_TODEVICE);
dev_kfree_skb(bf->skb);
dev_kfree_skb_any(bf->skb);
bf->skb = NULL;
}

Expand Down Expand Up @@ -466,6 +466,7 @@ ath5k_pci_probe(struct pci_dev *pdev,
mutex_init(&sc->lock);
spin_lock_init(&sc->rxbuflock);
spin_lock_init(&sc->txbuflock);
spin_lock_init(&sc->block);

/* Set private data */
pci_set_drvdata(pdev, hw);
Expand Down Expand Up @@ -2179,8 +2180,11 @@ ath5k_beacon_config(struct ath5k_softc *sc)

sc->imask |= AR5K_INT_SWBA;

if (ath5k_hw_hasveol(ah))
if (ath5k_hw_hasveol(ah)) {
spin_lock(&sc->block);
ath5k_beacon_send(sc);
spin_unlock(&sc->block);
}
}
/* TODO else AP */

Expand Down Expand Up @@ -2403,7 +2407,9 @@ ath5k_intr(int irq, void *dev_id)
TSF_TO_TU(tsf),
(unsigned long long) tsf);
} else {
spin_lock(&sc->block);
ath5k_beacon_send(sc);
spin_unlock(&sc->block);
}
}
if (status & AR5K_INT_RXEOL) {
Expand Down Expand Up @@ -2745,6 +2751,11 @@ static int ath5k_add_interface(struct ieee80211_hw *hw,
ret = -EOPNOTSUPP;
goto end;
}

/* Set to a reasonable value. Note that this will
* be set to mac80211's value at ath5k_config(). */
sc->bintval = 1000;

ret = 0;
end:
mutex_unlock(&sc->lock);
Expand Down Expand Up @@ -2789,9 +2800,6 @@ ath5k_config_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
struct ath5k_hw *ah = sc->ah;
int ret;

/* Set to a reasonable value. Note that this will
* be set to mac80211's value at ath5k_config(). */
sc->bintval = 1000;
mutex_lock(&sc->lock);
if (sc->vif != vif) {
ret = -EIO;
Expand Down Expand Up @@ -3050,6 +3058,7 @@ static int
ath5k_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb)
{
struct ath5k_softc *sc = hw->priv;
unsigned long flags;
int ret;

ath5k_debug_dump_skb(sc, skb, "BC ", 1);
Expand All @@ -3059,12 +3068,14 @@ ath5k_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb)
goto end;
}

spin_lock_irqsave(&sc->block, flags);
ath5k_txbuf_free(sc, sc->bbuf);
sc->bbuf->skb = skb;
ret = ath5k_beacon_setup(sc, sc->bbuf);
if (ret)
sc->bbuf->skb = NULL;
else {
spin_unlock_irqrestore(&sc->block, flags);
if (!ret) {
ath5k_beacon_config(sc);
mmiowb();
}
Expand Down
1 change: 1 addition & 0 deletions drivers/net/wireless/ath5k/base.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ struct ath5k_softc {
struct tasklet_struct txtq; /* tx intr tasklet */
struct ath5k_led tx_led; /* tx led */

spinlock_t block; /* protects beacon */
struct ath5k_buf *bbuf; /* beacon buffer */
unsigned int bhalq, /* SW q for outgoing beacons */
bmisscount, /* missed beacon transmits */
Expand Down
51 changes: 31 additions & 20 deletions drivers/net/wireless/atmel.c
Original file line number Diff line number Diff line change
Expand Up @@ -1304,7 +1304,7 @@ EXPORT_SYMBOL(atmel_open);
int atmel_open(struct net_device *dev)
{
struct atmel_private *priv = netdev_priv(dev);
int i, channel;
int i, channel, err;

/* any scheduled timer is no longer needed and might screw things up.. */
del_timer_sync(&priv->management_timer);
Expand All @@ -1328,8 +1328,9 @@ int atmel_open(struct net_device *dev)
priv->site_survey_state = SITE_SURVEY_IDLE;
priv->station_is_associated = 0;

if (!reset_atmel_card(dev))
return -EAGAIN;
err = reset_atmel_card(dev);
if (err)
return err;

if (priv->config_reg_domain) {
priv->reg_domain = priv->config_reg_domain;
Expand Down Expand Up @@ -3061,12 +3062,20 @@ static void authenticate(struct atmel_private *priv, u16 frame_len)
}

if (status == WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG) {
/* Do opensystem first, then try sharedkey */
/* Flip back and forth between WEP auth modes until the max
* authentication tries has been exceeded.
*/
if (system == WLAN_AUTH_OPEN) {
priv->CurrentAuthentTransactionSeqNum = 0x001;
priv->exclude_unencrypted = 1;
send_authentication_request(priv, WLAN_AUTH_SHARED_KEY, NULL, 0);
return;
} else if ( system == WLAN_AUTH_SHARED_KEY
&& priv->wep_is_on) {
priv->CurrentAuthentTransactionSeqNum = 0x001;
priv->exclude_unencrypted = 0;
send_authentication_request(priv, WLAN_AUTH_OPEN, NULL, 0);
return;
} else if (priv->connect_to_any_BSS) {
int bss_index;

Expand Down Expand Up @@ -3580,12 +3589,12 @@ static int atmel_wakeup_firmware(struct atmel_private *priv)

if (i == 0) {
printk(KERN_ALERT "%s: MAC failed to boot.\n", priv->dev->name);
return 0;
return -EIO;
}

if ((priv->host_info_base = atmel_read16(priv->dev, MR2)) == 0xffff) {
printk(KERN_ALERT "%s: card missing.\n", priv->dev->name);
return 0;
return -ENODEV;
}

/* now check for completion of MAC initialization through
Expand All @@ -3609,19 +3618,19 @@ static int atmel_wakeup_firmware(struct atmel_private *priv)
if (i == 0) {
printk(KERN_ALERT "%s: MAC failed to initialise.\n",
priv->dev->name);
return 0;
return -EIO;
}

/* Check for MAC_INIT_OK only on the register that the MAC_INIT_OK was set */
if ((mr3 & MAC_INIT_COMPLETE) &&
!(atmel_read16(priv->dev, MR3) & MAC_INIT_OK)) {
printk(KERN_ALERT "%s: MAC failed MR3 self-test.\n", priv->dev->name);
return 0;
return -EIO;
}
if ((mr1 & MAC_INIT_COMPLETE) &&
!(atmel_read16(priv->dev, MR1) & MAC_INIT_OK)) {
printk(KERN_ALERT "%s: MAC failed MR1 self-test.\n", priv->dev->name);
return 0;
return -EIO;
}

atmel_copy_to_host(priv->dev, (unsigned char *)iface,
Expand All @@ -3642,7 +3651,7 @@ static int atmel_wakeup_firmware(struct atmel_private *priv)
iface->func_ctrl = le16_to_cpu(iface->func_ctrl);
iface->mac_status = le16_to_cpu(iface->mac_status);

return 1;
return 0;
}

/* determine type of memory and MAC address */
Expand Down Expand Up @@ -3693,7 +3702,7 @@ static int probe_atmel_card(struct net_device *dev)
/* Standard firmware in flash, boot it up and ask
for the Mac Address */
priv->card_type = CARD_TYPE_SPI_FLASH;
if (atmel_wakeup_firmware(priv)) {
if (atmel_wakeup_firmware(priv) == 0) {
atmel_get_mib(priv, Mac_Address_Mib_Type, 0, dev->dev_addr, 6);

/* got address, now squash it again until the network
Expand Down Expand Up @@ -3835,6 +3844,7 @@ static int reset_atmel_card(struct net_device *dev)
struct atmel_private *priv = netdev_priv(dev);
u8 configuration;
int old_state = priv->station_state;
int err = 0;

/* data to add to the firmware names, in priority order
this implemenents firmware versioning */
Expand Down Expand Up @@ -3868,11 +3878,12 @@ static int reset_atmel_card(struct net_device *dev)
dev->name);
strcpy(priv->firmware_id, "atmel_at76c502.bin");
}
if (request_firmware(&fw_entry, priv->firmware_id, priv->sys_dev) != 0) {
err = request_firmware(&fw_entry, priv->firmware_id, priv->sys_dev);
if (err != 0) {
printk(KERN_ALERT
"%s: firmware %s is missing, cannot continue.\n",
dev->name, priv->firmware_id);
return 0;
return err;
}
} else {
int fw_index = 0;
Expand Down Expand Up @@ -3901,7 +3912,7 @@ static int reset_atmel_card(struct net_device *dev)
"%s: firmware %s is missing, cannot start.\n",
dev->name, priv->firmware_id);
priv->firmware_id[0] = '\0';
return 0;
return -ENOENT;
}
}

Expand All @@ -3926,8 +3937,9 @@ static int reset_atmel_card(struct net_device *dev)
release_firmware(fw_entry);
}

if (!atmel_wakeup_firmware(priv))
return 0;
err = atmel_wakeup_firmware(priv);
if (err != 0)
return err;

/* Check the version and set the correct flag for wpa stuff,
old and new firmware is incompatible.
Expand Down Expand Up @@ -3968,10 +3980,9 @@ static int reset_atmel_card(struct net_device *dev)
if (!priv->radio_on_broken) {
if (atmel_send_command_wait(priv, CMD_EnableRadio, NULL, 0) ==
CMD_STATUS_REJECTED_RADIO_OFF) {
printk(KERN_INFO
"%s: cannot turn the radio on. (Hey radio, you're beautiful!)\n",
printk(KERN_INFO "%s: cannot turn the radio on.\n",
dev->name);
return 0;
return -EIO;
}
}

Expand Down Expand Up @@ -4006,7 +4017,7 @@ static int reset_atmel_card(struct net_device *dev)
wireless_send_event(priv->dev, SIOCGIWAP, &wrqu, NULL);
}

return 1;
return 0;
}

static void atmel_send_command(struct atmel_private *priv, int command,
Expand Down
24 changes: 12 additions & 12 deletions net/mac80211/debugfs_netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,8 @@ IEEE80211_IF_WFILE(min_discovery_timeout,
static void add_sta_files(struct ieee80211_sub_if_data *sdata)
{
DEBUGFS_ADD(drop_unencrypted, sta);
DEBUGFS_ADD(force_unicast_rateidx, ap);
DEBUGFS_ADD(max_ratectrl_rateidx, ap);
DEBUGFS_ADD(force_unicast_rateidx, sta);
DEBUGFS_ADD(max_ratectrl_rateidx, sta);

DEBUGFS_ADD(state, sta);
DEBUGFS_ADD(bssid, sta);
Expand Down Expand Up @@ -283,17 +283,17 @@ static void add_ap_files(struct ieee80211_sub_if_data *sdata)
static void add_wds_files(struct ieee80211_sub_if_data *sdata)
{
DEBUGFS_ADD(drop_unencrypted, wds);
DEBUGFS_ADD(force_unicast_rateidx, ap);
DEBUGFS_ADD(max_ratectrl_rateidx, ap);
DEBUGFS_ADD(force_unicast_rateidx, wds);
DEBUGFS_ADD(max_ratectrl_rateidx, wds);

DEBUGFS_ADD(peer, wds);
}

static void add_vlan_files(struct ieee80211_sub_if_data *sdata)
{
DEBUGFS_ADD(drop_unencrypted, vlan);
DEBUGFS_ADD(force_unicast_rateidx, ap);
DEBUGFS_ADD(max_ratectrl_rateidx, ap);
DEBUGFS_ADD(force_unicast_rateidx, vlan);
DEBUGFS_ADD(max_ratectrl_rateidx, vlan);
}

static void add_monitor_files(struct ieee80211_sub_if_data *sdata)
Expand Down Expand Up @@ -381,8 +381,8 @@ static void add_files(struct ieee80211_sub_if_data *sdata)
static void del_sta_files(struct ieee80211_sub_if_data *sdata)
{
DEBUGFS_DEL(drop_unencrypted, sta);
DEBUGFS_DEL(force_unicast_rateidx, ap);
DEBUGFS_DEL(max_ratectrl_rateidx, ap);
DEBUGFS_DEL(force_unicast_rateidx, sta);
DEBUGFS_DEL(max_ratectrl_rateidx, sta);

DEBUGFS_DEL(state, sta);
DEBUGFS_DEL(bssid, sta);
Expand Down Expand Up @@ -416,17 +416,17 @@ static void del_ap_files(struct ieee80211_sub_if_data *sdata)
static void del_wds_files(struct ieee80211_sub_if_data *sdata)
{
DEBUGFS_DEL(drop_unencrypted, wds);
DEBUGFS_DEL(force_unicast_rateidx, ap);
DEBUGFS_DEL(max_ratectrl_rateidx, ap);
DEBUGFS_DEL(force_unicast_rateidx, wds);
DEBUGFS_DEL(max_ratectrl_rateidx, wds);

DEBUGFS_DEL(peer, wds);
}

static void del_vlan_files(struct ieee80211_sub_if_data *sdata)
{
DEBUGFS_DEL(drop_unencrypted, vlan);
DEBUGFS_DEL(force_unicast_rateidx, ap);
DEBUGFS_DEL(max_ratectrl_rateidx, ap);
DEBUGFS_DEL(force_unicast_rateidx, vlan);
DEBUGFS_DEL(max_ratectrl_rateidx, vlan);
}

static void del_monitor_files(struct ieee80211_sub_if_data *sdata)
Expand Down
6 changes: 6 additions & 0 deletions net/mac80211/ieee80211_i.h
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,8 @@ struct ieee80211_sub_if_data {
struct dentry *auth_transaction;
struct dentry *flags;
struct dentry *num_beacons_sta;
struct dentry *force_unicast_rateidx;
struct dentry *max_ratectrl_rateidx;
} sta;
struct {
struct dentry *drop_unencrypted;
Expand All @@ -483,9 +485,13 @@ struct ieee80211_sub_if_data {
struct {
struct dentry *drop_unencrypted;
struct dentry *peer;
struct dentry *force_unicast_rateidx;
struct dentry *max_ratectrl_rateidx;
} wds;
struct {
struct dentry *drop_unencrypted;
struct dentry *force_unicast_rateidx;
struct dentry *max_ratectrl_rateidx;
} vlan;
struct {
struct dentry *mode;
Expand Down
2 changes: 1 addition & 1 deletion net/mac80211/mesh.c
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ struct mesh_table *mesh_table_grow(struct mesh_table *tbl)
hlist_for_each_safe(p, q, &newtbl->hash_buckets[i])
tbl->free_node(p, 0);
}
__mesh_table_free(tbl);
__mesh_table_free(newtbl);
endgrow:
return NULL;
}
Expand Down
Loading

0 comments on commit 6c36810

Please sign in to comment.