Skip to content

Commit

Permalink
Merge branch 'upstream-fixes' of git://git.kernel.org/pub/scm/linux/k…
Browse files Browse the repository at this point in the history
…ernel/git/linville/wireless-2.6 into upstream-fixes
  • Loading branch information
Jeff Garzik committed Oct 21, 2006
2 parents cfadbd2 + 41072a1 commit cde49b0
Show file tree
Hide file tree
Showing 16 changed files with 238 additions and 151 deletions.
105 changes: 76 additions & 29 deletions drivers/net/wireless/airo.c
Original file line number Diff line number Diff line change
Expand Up @@ -2897,6 +2897,8 @@ static struct net_device *_init_airo_card( unsigned short irq, int port,
goto err_out_map;
}
ai->wifidev = init_wifidev(ai, dev);
if (!ai->wifidev)
goto err_out_reg;

set_bit(FLAG_REGISTERED,&ai->flags);
airo_print_info(dev->name, "MAC enabled %x:%x:%x:%x:%x:%x",
Expand All @@ -2908,11 +2910,18 @@ static struct net_device *_init_airo_card( unsigned short irq, int port,
for( i = 0; i < MAX_FIDS; i++ )
ai->fids[i] = transmit_allocate(ai,AIRO_DEF_MTU,i>=MAX_FIDS/2);

setup_proc_entry( dev, dev->priv ); /* XXX check for failure */
if (setup_proc_entry(dev, dev->priv) < 0)
goto err_out_wifi;

netif_start_queue(dev);
SET_MODULE_OWNER(dev);
return dev;

err_out_wifi:
unregister_netdev(ai->wifidev);
free_netdev(ai->wifidev);
err_out_reg:
unregister_netdev(dev);
err_out_map:
if (test_bit(FLAG_MPI,&ai->flags) && pci) {
pci_free_consistent(pci, PCI_SHARED_LEN, ai->shared, ai->shared_dma);
Expand Down Expand Up @@ -3089,7 +3098,8 @@ static int airo_thread(void *data) {
set_bit(JOB_AUTOWEP, &ai->jobs);
break;
}
if (!kthread_should_stop()) {
if (!kthread_should_stop() &&
!freezing(current)) {
unsigned long wake_at;
if (!ai->expires || !ai->scan_timeout) {
wake_at = max(ai->expires,
Expand All @@ -3101,7 +3111,8 @@ static int airo_thread(void *data) {
schedule_timeout(wake_at - jiffies);
continue;
}
} else if (!kthread_should_stop()) {
} else if (!kthread_should_stop() &&
!freezing(current)) {
schedule();
continue;
}
Expand Down Expand Up @@ -4495,91 +4506,128 @@ static int setup_proc_entry( struct net_device *dev,
apriv->proc_entry = create_proc_entry(apriv->proc_name,
S_IFDIR|airo_perm,
airo_entry);
apriv->proc_entry->uid = proc_uid;
apriv->proc_entry->gid = proc_gid;
apriv->proc_entry->owner = THIS_MODULE;
if (!apriv->proc_entry)
goto fail;
apriv->proc_entry->uid = proc_uid;
apriv->proc_entry->gid = proc_gid;
apriv->proc_entry->owner = THIS_MODULE;

/* Setup the StatsDelta */
entry = create_proc_entry("StatsDelta",
S_IFREG | (S_IRUGO&proc_perm),
apriv->proc_entry);
entry->uid = proc_uid;
entry->gid = proc_gid;
if (!entry)
goto fail_stats_delta;
entry->uid = proc_uid;
entry->gid = proc_gid;
entry->data = dev;
entry->owner = THIS_MODULE;
entry->owner = THIS_MODULE;
SETPROC_OPS(entry, proc_statsdelta_ops);

/* Setup the Stats */
entry = create_proc_entry("Stats",
S_IFREG | (S_IRUGO&proc_perm),
apriv->proc_entry);
entry->uid = proc_uid;
entry->gid = proc_gid;
if (!entry)
goto fail_stats;
entry->uid = proc_uid;
entry->gid = proc_gid;
entry->data = dev;
entry->owner = THIS_MODULE;
entry->owner = THIS_MODULE;
SETPROC_OPS(entry, proc_stats_ops);

/* Setup the Status */
entry = create_proc_entry("Status",
S_IFREG | (S_IRUGO&proc_perm),
apriv->proc_entry);
entry->uid = proc_uid;
entry->gid = proc_gid;
if (!entry)
goto fail_status;
entry->uid = proc_uid;
entry->gid = proc_gid;
entry->data = dev;
entry->owner = THIS_MODULE;
entry->owner = THIS_MODULE;
SETPROC_OPS(entry, proc_status_ops);

/* Setup the Config */
entry = create_proc_entry("Config",
S_IFREG | proc_perm,
apriv->proc_entry);
entry->uid = proc_uid;
entry->gid = proc_gid;
if (!entry)
goto fail_config;
entry->uid = proc_uid;
entry->gid = proc_gid;
entry->data = dev;
entry->owner = THIS_MODULE;
entry->owner = THIS_MODULE;
SETPROC_OPS(entry, proc_config_ops);

/* Setup the SSID */
entry = create_proc_entry("SSID",
S_IFREG | proc_perm,
apriv->proc_entry);
entry->uid = proc_uid;
entry->gid = proc_gid;
if (!entry)
goto fail_ssid;
entry->uid = proc_uid;
entry->gid = proc_gid;
entry->data = dev;
entry->owner = THIS_MODULE;
entry->owner = THIS_MODULE;
SETPROC_OPS(entry, proc_SSID_ops);

/* Setup the APList */
entry = create_proc_entry("APList",
S_IFREG | proc_perm,
apriv->proc_entry);
entry->uid = proc_uid;
entry->gid = proc_gid;
if (!entry)
goto fail_aplist;
entry->uid = proc_uid;
entry->gid = proc_gid;
entry->data = dev;
entry->owner = THIS_MODULE;
entry->owner = THIS_MODULE;
SETPROC_OPS(entry, proc_APList_ops);

/* Setup the BSSList */
entry = create_proc_entry("BSSList",
S_IFREG | proc_perm,
apriv->proc_entry);
if (!entry)
goto fail_bsslist;
entry->uid = proc_uid;
entry->gid = proc_gid;
entry->data = dev;
entry->owner = THIS_MODULE;
entry->owner = THIS_MODULE;
SETPROC_OPS(entry, proc_BSSList_ops);

/* Setup the WepKey */
entry = create_proc_entry("WepKey",
S_IFREG | proc_perm,
apriv->proc_entry);
entry->uid = proc_uid;
entry->gid = proc_gid;
if (!entry)
goto fail_wepkey;
entry->uid = proc_uid;
entry->gid = proc_gid;
entry->data = dev;
entry->owner = THIS_MODULE;
entry->owner = THIS_MODULE;
SETPROC_OPS(entry, proc_wepkey_ops);

return 0;

fail_wepkey:
remove_proc_entry("BSSList", apriv->proc_entry);
fail_bsslist:
remove_proc_entry("APList", apriv->proc_entry);
fail_aplist:
remove_proc_entry("SSID", apriv->proc_entry);
fail_ssid:
remove_proc_entry("Config", apriv->proc_entry);
fail_config:
remove_proc_entry("Status", apriv->proc_entry);
fail_status:
remove_proc_entry("Stats", apriv->proc_entry);
fail_stats:
remove_proc_entry("StatsDelta", apriv->proc_entry);
fail_stats_delta:
remove_proc_entry(apriv->proc_name, airo_entry);
fail:
return -ENOMEM;
}

static int takedown_proc_entry( struct net_device *dev,
Expand Down Expand Up @@ -5924,7 +5972,6 @@ static int airo_get_essid(struct net_device *dev,

/* Get the current SSID */
memcpy(extra, status_rid.SSID, status_rid.SSIDlen);
extra[status_rid.SSIDlen] = '\0';
/* If none, we may want to get the one that was set */

/* Push it out ! */
Expand Down
2 changes: 0 additions & 2 deletions drivers/net/wireless/atmel.c
Original file line number Diff line number Diff line change
Expand Up @@ -1678,11 +1678,9 @@ static int atmel_get_essid(struct net_device *dev,
/* Get the current SSID */
if (priv->new_SSID_size != 0) {
memcpy(extra, priv->new_SSID, priv->new_SSID_size);
extra[priv->new_SSID_size] = '\0';
dwrq->length = priv->new_SSID_size;
} else {
memcpy(extra, priv->SSID, priv->SSID_size);
extra[priv->SSID_size] = '\0';
dwrq->length = priv->SSID_size;
}

Expand Down
28 changes: 23 additions & 5 deletions drivers/net/wireless/bcm43xx/bcm43xx_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -705,11 +705,30 @@ int bcm43xx_dma_init(struct bcm43xx_private *bcm)
struct bcm43xx_dmaring *ring;
int err = -ENOMEM;
int dma64 = 0;
u32 sbtmstatehi;
u64 mask = bcm43xx_get_supported_dma_mask(bcm);
int nobits;

sbtmstatehi = bcm43xx_read32(bcm, BCM43xx_CIR_SBTMSTATEHIGH);
if (sbtmstatehi & BCM43xx_SBTMSTATEHIGH_DMA64BIT)
if (mask == DMA_64BIT_MASK) {
dma64 = 1;
nobits = 64;
} else if (mask == DMA_32BIT_MASK)
nobits = 32;
else
nobits = 30;
err = pci_set_dma_mask(bcm->pci_dev, mask);
err |= pci_set_consistent_dma_mask(bcm->pci_dev, mask);
if (err) {
#ifdef CONFIG_BCM43XX_PIO
printk(KERN_WARNING PFX "DMA not supported on this device."
" Falling back to PIO.\n");
bcm->__using_pio = 1;
return -ENOSYS;
#else
printk(KERN_ERR PFX "FATAL: DMA not supported and PIO not configured. "
"Please recompile the driver with PIO support.\n");
return -ENODEV;
#endif /* CONFIG_BCM43XX_PIO */
}

/* setup TX DMA channels. */
ring = bcm43xx_setup_dmaring(bcm, 0, 1, dma64);
Expand Down Expand Up @@ -755,8 +774,7 @@ int bcm43xx_dma_init(struct bcm43xx_private *bcm)
dma->rx_ring3 = ring;
}

dprintk(KERN_INFO PFX "%s DMA initialized\n",
dma64 ? "64-bit" : "32-bit");
dprintk(KERN_INFO PFX "%d-bit DMA initialized\n", nobits);
err = 0;
out:
return err;
Expand Down
17 changes: 17 additions & 0 deletions drivers/net/wireless/bcm43xx/bcm43xx_dma.h
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,23 @@ int bcm43xx_dma_tx(struct bcm43xx_private *bcm,
struct ieee80211_txb *txb);
void bcm43xx_dma_rx(struct bcm43xx_dmaring *ring);

/* Helper function that returns the dma mask for this device. */
static inline
u64 bcm43xx_get_supported_dma_mask(struct bcm43xx_private *bcm)
{
int dma64 = bcm43xx_read32(bcm, BCM43xx_CIR_SBTMSTATEHIGH) &
BCM43xx_SBTMSTATEHIGH_DMA64BIT;
u16 mmio_base = bcm43xx_dmacontroller_base(dma64, 0);
u32 mask = BCM43xx_DMA32_TXADDREXT_MASK;

if (dma64)
return DMA_64BIT_MASK;
bcm43xx_write32(bcm, mmio_base + BCM43xx_DMA32_TXCTL, mask);
if (bcm43xx_read32(bcm, mmio_base + BCM43xx_DMA32_TXCTL) & mask)
return DMA_32BIT_MASK;
return DMA_30BIT_MASK;
}

#else /* CONFIG_BCM43XX_DMA */


Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/bcm43xx/bcm43xx_leds.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ void bcm43xx_leds_update(struct bcm43xx_private *bcm, int activity)
//TODO
break;
case BCM43xx_LED_ASSOC:
if (bcm->softmac->associated)
if (bcm->softmac->associnfo.associated)
turn_on = 1;
break;
#ifdef CONFIG_BCM43XX_DEBUG
Expand Down
34 changes: 12 additions & 22 deletions drivers/net/wireless/bcm43xx/bcm43xx_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2925,10 +2925,13 @@ static int bcm43xx_wireless_core_init(struct bcm43xx_private *bcm,
bcm43xx_write16(bcm, 0x043C, 0x000C);

if (active_wlcore) {
if (bcm43xx_using_pio(bcm))
if (bcm43xx_using_pio(bcm)) {
err = bcm43xx_pio_init(bcm);
else
} else {
err = bcm43xx_dma_init(bcm);
if (err == -ENOSYS)
err = bcm43xx_pio_init(bcm);
}
if (err)
goto err_chip_cleanup;
}
Expand Down Expand Up @@ -3164,12 +3167,12 @@ static void bcm43xx_periodic_work_handler(void *d)
u32 savedirqs = 0;
int badness;

mutex_lock(&bcm->mutex);
badness = estimate_periodic_work_badness(bcm->periodic_state);
if (badness > BADNESS_LIMIT) {
/* Periodic work will take a long time, so we want it to
* be preemtible.
*/
mutex_lock(&bcm->mutex);
netif_tx_disable(bcm->net_dev);
spin_lock_irqsave(&bcm->irq_lock, flags);
bcm43xx_mac_suspend(bcm);
Expand All @@ -3182,7 +3185,6 @@ static void bcm43xx_periodic_work_handler(void *d)
/* Periodic work should take short time, so we want low
* locking overhead.
*/
mutex_lock(&bcm->mutex);
spin_lock_irqsave(&bcm->irq_lock, flags);
}

Expand Down Expand Up @@ -3993,8 +3995,6 @@ static int bcm43xx_init_private(struct bcm43xx_private *bcm,
struct net_device *net_dev,
struct pci_dev *pci_dev)
{
int err;

bcm43xx_set_status(bcm, BCM43xx_STAT_UNINIT);
bcm->ieee = netdev_priv(net_dev);
bcm->softmac = ieee80211_priv(net_dev);
Expand All @@ -4012,22 +4012,8 @@ static int bcm43xx_init_private(struct bcm43xx_private *bcm,
(void (*)(unsigned long))bcm43xx_interrupt_tasklet,
(unsigned long)bcm);
tasklet_disable_nosync(&bcm->isr_tasklet);
if (modparam_pio) {
if (modparam_pio)
bcm->__using_pio = 1;
} else {
err = pci_set_dma_mask(pci_dev, DMA_30BIT_MASK);
err |= pci_set_consistent_dma_mask(pci_dev, DMA_30BIT_MASK);
if (err) {
#ifdef CONFIG_BCM43XX_PIO
printk(KERN_WARNING PFX "DMA not supported. Falling back to PIO.\n");
bcm->__using_pio = 1;
#else
printk(KERN_ERR PFX "FATAL: DMA not supported and PIO not configured. "
"Recompile the driver with PIO support, please.\n");
return -ENODEV;
#endif /* CONFIG_BCM43XX_PIO */
}
}
bcm->rts_threshold = BCM43xx_DEFAULT_RTS_THRESHOLD;

/* default to sw encryption for now */
Expand Down Expand Up @@ -4208,7 +4194,11 @@ static int bcm43xx_resume(struct pci_dev *pdev)
dprintk(KERN_INFO PFX "Resuming...\n");

pci_set_power_state(pdev, 0);
pci_enable_device(pdev);
err = pci_enable_device(pdev);
if (err) {
printk(KERN_ERR PFX "Failure with pci_enable_device!\n");
return err;
}
pci_restore_state(pdev);

bcm43xx_chipset_attach(bcm);
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/bcm43xx/bcm43xx_wx.c
Original file line number Diff line number Diff line change
Expand Up @@ -847,7 +847,7 @@ static struct iw_statistics *bcm43xx_get_wireless_stats(struct net_device *net_d
unsigned long flags;

wstats = &bcm->stats.wstats;
if (!mac->associated) {
if (!mac->associnfo.associated) {
wstats->miss.beacon = 0;
// bcm->ieee->ieee_stats.tx_retry_limit_exceeded = 0; // FIXME: should this be cleared here?
wstats->discard.retries = 0;
Expand Down
Loading

0 comments on commit cde49b0

Please sign in to comment.