* (WaveLAN modem or i82586)
*/
-/*------------------------------------------------------------------*/
-/*
- * Wrapper for disabling interrupts and locking the driver.
- * (note : inline, so optimised away)
- */
-static inline void wv_splhi(net_local * lp,
- unsigned long * pflags)
-{
- spin_lock_irqsave(&lp->spinlock, *pflags);
- /* Note : above does the cli(); itself */
-}
-
-/*------------------------------------------------------------------*/
-/*
- * Wrapper for re-enabling interrupts and un-locking the driver.
- */
-static inline void wv_splx(net_local * lp,
- unsigned long * pflags)
-{
- spin_unlock_irqrestore(&lp->spinlock, *pflags);
-}
-
/*------------------------------------------------------------------*/
/*
* Translate irq number to PSA irq parameter
/* Check if we can do it now ! */
if((netif_running(dev)) && !(netif_queue_stopped(dev))) {
- wv_splhi(lp, &flags);
+ spin_lock_irqsave(&lp->spinlock, flags);
/* May fail */
wv_82586_config(dev);
- wv_splx(lp, &flags);
+ spin_unlock_irqrestore(&lp->spinlock, flags);
}
else {
#ifdef DEBUG_CONFIG_INFO
int ret = 0;
/* Disable interrupts and save flags. */
- wv_splhi(lp, &flags);
+ spin_lock_irqsave(&lp->spinlock, flags);
/* Set NWID in WaveLAN. */
if (!wrqu->nwid.disabled) {
update_psa_checksum(dev, ioaddr, lp->hacr);
/* Enable interrupts and restore flags. */
- wv_splx(lp, &flags);
+ spin_unlock_irqrestore(&lp->spinlock, flags);
return ret;
}
int ret = 0;
/* Disable interrupts and save flags. */
- wv_splhi(lp, &flags);
+ spin_lock_irqsave(&lp->spinlock, flags);
/* Read the NWID. */
psa_read(ioaddr, lp->hacr,
wrqu->nwid.fixed = 1; /* Superfluous */
/* Enable interrupts and restore flags. */
- wv_splx(lp, &flags);
+ spin_unlock_irqrestore(&lp->spinlock, flags);
return ret;
}
int ret;
/* Disable interrupts and save flags. */
- wv_splhi(lp, &flags);
+ spin_lock_irqsave(&lp->spinlock, flags);
/* Attempt to recognise 2.00 cards (2.4 GHz frequency selectable). */
if (!(mmc_in(ioaddr, mmroff(0, mmr_fee_status)) &
ret = -EOPNOTSUPP;
/* Enable interrupts and restore flags. */
- wv_splx(lp, &flags);
+ spin_unlock_irqrestore(&lp->spinlock, flags);
return ret;
}
int ret = 0;
/* Disable interrupts and save flags. */
- wv_splhi(lp, &flags);
+ spin_lock_irqsave(&lp->spinlock, flags);
/* Attempt to recognise 2.00 cards (2.4 GHz frequency selectable).
* Does it work for everybody, especially old cards? */
}
/* Enable interrupts and restore flags. */
- wv_splx(lp, &flags);
+ spin_unlock_irqrestore(&lp->spinlock, flags);
return ret;
}
int ret = 0;
/* Disable interrupts and save flags. */
- wv_splhi(lp, &flags);
+ spin_lock_irqsave(&lp->spinlock, flags);
/* Set the level threshold. */
/* We should complain loudly if wrqu->sens.fixed = 0, because we
psa.psa_thr_pre_set);
/* Enable interrupts and restore flags. */
- wv_splx(lp, &flags);
+ spin_unlock_irqrestore(&lp->spinlock, flags);
return ret;
}
int ret = 0;
/* Disable interrupts and save flags. */
- wv_splhi(lp, &flags);
+ spin_lock_irqsave(&lp->spinlock, flags);
/* Read the level threshold. */
psa_read(ioaddr, lp->hacr,
wrqu->sens.fixed = 1;
/* Enable interrupts and restore flags. */
- wv_splx(lp, &flags);
+ spin_unlock_irqrestore(&lp->spinlock, flags);
return ret;
}
int ret = 0;
/* Disable interrupts and save flags. */
- wv_splhi(lp, &flags);
+ spin_lock_irqsave(&lp->spinlock, flags);
/* Check if capable of encryption */
if (!mmc_encr(ioaddr)) {
}
/* Enable interrupts and restore flags. */
- wv_splx(lp, &flags);
+ spin_unlock_irqrestore(&lp->spinlock, flags);
return ret;
}
int ret = 0;
/* Disable interrupts and save flags. */
- wv_splhi(lp, &flags);
+ spin_lock_irqsave(&lp->spinlock, flags);
/* Check if encryption is available */
if (!mmc_encr(ioaddr)) {
}
/* Enable interrupts and restore flags. */
- wv_splx(lp, &flags);
+ spin_unlock_irqrestore(&lp->spinlock, flags);
return ret;
}
range->bitrate[0] = 2000000; /* 2 Mb/s */
/* Disable interrupts and save flags. */
- wv_splhi(lp, &flags);
+ spin_lock_irqsave(&lp->spinlock, flags);
/* Attempt to recognise 2.00 cards (2.4 GHz frequency selectable). */
if (!(mmc_in(ioaddr, mmroff(0, mmr_fee_status)) &
}
/* Enable interrupts and restore flags. */
- wv_splx(lp, &flags);
+ spin_unlock_irqrestore(&lp->spinlock, flags);
return ret;
}
unsigned long flags;
/* Disable interrupts and save flags. */
- wv_splhi(lp, &flags);
+ spin_lock_irqsave(&lp->spinlock, flags);
psa.psa_quality_thr = *(extra) & 0x0F;
psa_write(ioaddr, lp->hacr,
psa.psa_quality_thr);
/* Enable interrupts and restore flags. */
- wv_splx(lp, &flags);
+ spin_unlock_irqrestore(&lp->spinlock, flags);
return 0;
}
unsigned long flags;
/* Disable interrupts and save flags. */
- wv_splhi(lp, &flags);
+ spin_lock_irqsave(&lp->spinlock, flags);
psa_read(ioaddr, lp->hacr,
(char *) &psa.psa_quality_thr - (char *) &psa,
*(extra) = psa.psa_quality_thr & 0x0F;
/* Enable interrupts and restore flags. */
- wv_splx(lp, &flags);
+ spin_unlock_irqrestore(&lp->spinlock, flags);
return 0;
}
return (iw_stats *) NULL;
/* Disable interrupts and save flags. */
- wv_splhi(lp, &flags);
+ spin_lock_irqsave(&lp->spinlock, flags);
wstats = &lp->wstats;
wstats->discard.misc = 0L;
/* Enable interrupts and restore flags. */
- wv_splx(lp, &flags);
+ spin_unlock_irqrestore(&lp->spinlock, flags);
#ifdef DEBUG_IOCTL_TRACE
printk(KERN_DEBUG "%s: <-wavelan_get_wireless_stats()\n",
if (clen < ETH_ZLEN)
clen = ETH_ZLEN;
- wv_splhi(lp, &flags);
+ spin_lock_irqsave(&lp->spinlock, flags);
/* Check nothing bad has happened */
if (lp->tx_n_in_use == (NTXBLOCKS - 1)) {
printk(KERN_INFO "%s: wv_packet_write(): Tx queue full.\n",
dev->name);
#endif
- wv_splx(lp, &flags);
+ spin_unlock_irqrestore(&lp->spinlock, flags);
return 1;
}
if (lp->tx_n_in_use < NTXBLOCKS - 1)
netif_wake_queue(dev);
- wv_splx(lp, &flags);
+ spin_unlock_irqrestore(&lp->spinlock, flags);
#ifdef DEBUG_TX_INFO
wv_packet_info((u8 *) buf, length, dev->name,
* we can do it now.
*/
if (lp->reconfig_82586) {
- wv_splhi(lp, &flags);
+ spin_lock_irqsave(&lp->spinlock, flags);
wv_82586_config(dev);
- wv_splx(lp, &flags);
+ spin_unlock_irqrestore(&lp->spinlock, flags);
/* Check that we can continue */
if (lp->tx_n_in_use == (NTXBLOCKS - 1))
return 1;
/* Prevent reentrancy. We need to do that because we may have
* multiple interrupt handler running concurrently.
- * It is safe because wv_splhi() disables interrupts before acquiring
+ * It is safe because interrupts are disabled before acquiring
* the spinlock. */
spin_lock(&lp->spinlock);
return;
}
- wv_splhi(lp, &flags);
+ spin_lock_irqsave(&lp->spinlock, flags);
/* Try to see if some buffers are not free (in case we missed
* an interrupt */
if (lp->tx_n_in_use < NTXBLOCKS - 1)
netif_wake_queue(dev);
- wv_splx(lp, &flags);
+ spin_unlock_irqrestore(&lp->spinlock, flags);
#ifdef DEBUG_INTERRUPT_TRACE
printk(KERN_DEBUG "%s: <-wavelan_watchdog()\n", dev->name);
return -EAGAIN;
}
- wv_splhi(lp, &flags);
+ spin_lock_irqsave(&lp->spinlock, flags);
if (wv_hw_reset(dev) != -1) {
netif_start_queue(dev);
"%s: wavelan_open(): impossible to start the card\n",
dev->name);
#endif
- wv_splx(lp, &flags);
+ spin_unlock_irqrestore(&lp->spinlock, flags);
return -EAGAIN;
}
- wv_splx(lp, &flags);
+ spin_unlock_irqrestore(&lp->spinlock, flags);
#ifdef DEBUG_CALLBACK_TRACE
printk(KERN_DEBUG "%s: <-wavelan_open()\n", dev->name);
/*
* Flush the Tx and disable Rx.
*/
- wv_splhi(lp, &flags);
+ spin_lock_irqsave(&lp->spinlock, flags);
wv_82586_stop(dev);
- wv_splx(lp, &flags);
+ spin_unlock_irqrestore(&lp->spinlock, flags);
free_irq(dev->irq, dev);
* (wavelan modem or i82593)
*/
-/*------------------------------------------------------------------*/
-/*
- * Wrapper for disabling interrupts.
- * (note : inline, so optimised away)
- */
-static inline void
-wv_splhi(net_local * lp,
- unsigned long * pflags)
-{
- spin_lock_irqsave(&lp->spinlock, *pflags);
- /* Note : above does the cli(); itself */
-}
-
-/*------------------------------------------------------------------*/
-/*
- * Wrapper for re-enabling interrupts.
- */
-static inline void
-wv_splx(net_local * lp,
- unsigned long * pflags)
-{
- spin_unlock_irqrestore(&lp->spinlock, *pflags);
-
- /* Note : enabling interrupts on the hardware is done in wv_ru_start()
- * via : outb(OP1_INT_ENABLE, LCCR(base));
- */
-}
-
/*------------------------------------------------------------------*/
/*
* Wrapper for reporting error to cardservices
#endif
/* Disable interrupts & save flags */
- wv_splhi(lp, &flags);
+ spin_lock_irqsave(&lp->spinlock, flags);
m.w.mmw_loopt_sel = (mode==NWID_PROMISC) ? MMW_LOOPT_SEL_DIS_NWID : 0x00;
mmc_write(lp->dev->base_addr, (char *)&m.w.mmw_loopt_sel - (char *)&m, (unsigned char *)&m.w.mmw_loopt_sel, 1);
lp->cell_search=0;
/* ReEnable interrupts & restore flags */
- wv_splx(lp, &flags);
+ spin_unlock_irqrestore(&lp->spinlock, flags);
}
/* Find a record in the WavePoint table matching a given NWID */
#endif
/* Disable interrupts & save flags */
- wv_splhi(lp, &flags);
+ spin_lock_irqsave(&lp->spinlock, flags);
m.w.mmw_netw_id_l = wavepoint->nwid & 0xFF;
m.w.mmw_netw_id_h = (wavepoint->nwid & 0xFF00) >> 8;
mmc_write(base, (char *)&m.w.mmw_netw_id_l - (char *)&m, (unsigned char *)&m.w.mmw_netw_id_l, 2);
/* ReEnable interrupts & restore flags */
- wv_splx(lp, &flags);
+ spin_unlock_irqrestore(&lp->spinlock, flags);
wv_nwid_filter(!NWID_PROMISC,lp);
lp->curr_point=wavepoint;
/* Check if we can do it now ! */
if((link->open) && (netif_running(dev)) && !(netif_queue_stopped(dev)))
{
- wv_splhi(lp, &flags); /* Disable interrupts */
+ spin_lock_irqsave(&lp->spinlock, flags); /* Disable interrupts */
wv_82593_config(dev);
- wv_splx(lp, &flags); /* Re-enable interrupts */
+ spin_unlock_irqrestore(&lp->spinlock, flags); /* Re-enable interrupts */
}
else
{
return;
}
- wv_splhi(lp, &flags);
+ spin_lock_irqsave(&lp->spinlock, flags);
/* Read the mmc */
mmc_out(base, mmwoff(0, mmw_freeze), 1);
lp->wstats.discard.nwid += (m.mmr_wrong_nwid_h << 8) | m.mmr_wrong_nwid_l;
#endif /* WIRELESS_EXT */
- wv_splx(lp, &flags);
+ spin_unlock_irqrestore(&lp->spinlock, flags);
printk(KERN_DEBUG "##### wavelan modem status registers: #####\n");
#ifdef DEBUG_SHOW_UNUSED
int ret = 0;
/* Disable interrupts and save flags. */
- wv_splhi(lp, &flags);
+ spin_lock_irqsave(&lp->spinlock, flags);
/* Set NWID in WaveLAN. */
#if WIRELESS_EXT > 8
update_psa_checksum(dev);
/* Enable interrupts and restore flags. */
- wv_splx(lp, &flags);
+ spin_unlock_irqrestore(&lp->spinlock, flags);
return ret;
}
int ret = 0;
/* Disable interrupts and save flags. */
- wv_splhi(lp, &flags);
+ spin_lock_irqsave(&lp->spinlock, flags);
/* Read the NWID. */
psa_read(dev,
#endif /* WIRELESS_EXT > 8 */
/* Enable interrupts and restore flags. */
- wv_splx(lp, &flags);
+ spin_unlock_irqrestore(&lp->spinlock, flags);
return ret;
}
int ret;
/* Disable interrupts and save flags. */
- wv_splhi(lp, &flags);
+ spin_lock_irqsave(&lp->spinlock, flags);
/* Attempt to recognise 2.00 cards (2.4 GHz frequency selectable). */
if (!(mmc_in(base, mmroff(0, mmr_fee_status)) &
ret = -EOPNOTSUPP;
/* Enable interrupts and restore flags. */
- wv_splx(lp, &flags);
+ spin_unlock_irqrestore(&lp->spinlock, flags);
return ret;
}
int ret = 0;
/* Disable interrupts and save flags. */
- wv_splhi(lp, &flags);
+ spin_lock_irqsave(&lp->spinlock, flags);
/* Attempt to recognise 2.00 cards (2.4 GHz frequency selectable).
* Does it work for everybody, especially old cards? */
}
/* Enable interrupts and restore flags. */
- wv_splx(lp, &flags);
+ spin_unlock_irqrestore(&lp->spinlock, flags);
return ret;
}
int ret = 0;
/* Disable interrupts and save flags. */
- wv_splhi(lp, &flags);
+ spin_lock_irqsave(&lp->spinlock, flags);
/* Set the level threshold. */
#if WIRELESS_EXT > 7
psa.psa_thr_pre_set);
/* Enable interrupts and restore flags. */
- wv_splx(lp, &flags);
+ spin_unlock_irqrestore(&lp->spinlock, flags);
return ret;
}
int ret = 0;
/* Disable interrupts and save flags. */
- wv_splhi(lp, &flags);
+ spin_lock_irqsave(&lp->spinlock, flags);
/* Read the level threshold. */
psa_read(dev,
#endif /* WIRELESS_EXT > 7 */
/* Enable interrupts and restore flags. */
- wv_splx(lp, &flags);
+ spin_unlock_irqrestore(&lp->spinlock, flags);
return ret;
}
int ret = 0;
/* Disable interrupts and save flags. */
- wv_splhi(lp, &flags);
+ spin_lock_irqsave(&lp->spinlock, flags);
/* Check if capable of encryption */
if (!mmc_encr(base)) {
}
/* Enable interrupts and restore flags. */
- wv_splx(lp, &flags);
+ spin_unlock_irqrestore(&lp->spinlock, flags);
return ret;
}
int ret = 0;
/* Disable interrupts and save flags. */
- wv_splhi(lp, &flags);
+ spin_lock_irqsave(&lp->spinlock, flags);
/* Check if encryption is available */
if (!mmc_encr(base)) {
}
/* Enable interrupts and restore flags. */
- wv_splx(lp, &flags);
+ spin_unlock_irqrestore(&lp->spinlock, flags);
return ret;
}
int ret = 0;
/* Disable interrupts and save flags. */
- wv_splhi(lp, &flags);
+ spin_lock_irqsave(&lp->spinlock, flags);
/* Check if disable */
if(wrqu->data.flags == 0)
}
/* Enable interrupts and restore flags. */
- wv_splx(lp, &flags);
+ spin_unlock_irqrestore(&lp->spinlock, flags);
return ret;
}
int ret = 0;
/* Disable interrupts and save flags. */
- wv_splhi(lp, &flags);
+ spin_lock_irqsave(&lp->spinlock, flags);
/* Check mode */
switch(wrqu->mode) {
}
/* Enable interrupts and restore flags. */
- wv_splx(lp, &flags);
+ spin_unlock_irqrestore(&lp->spinlock, flags);
return ret;
}
#endif /* WIRELESS_EXT > 7 */
/* Disable interrupts and save flags. */
- wv_splhi(lp, &flags);
+ spin_lock_irqsave(&lp->spinlock, flags);
/* Attempt to recognise 2.00 cards (2.4 GHz frequency selectable). */
if (!(mmc_in(base, mmroff(0, mmr_fee_status)) &
#endif /* WIRELESS_EXT > 8 */
/* Enable interrupts and restore flags. */
- wv_splx(lp, &flags);
+ spin_unlock_irqrestore(&lp->spinlock, flags);
return ret;
}
unsigned long flags;
/* Disable interrupts and save flags. */
- wv_splhi(lp, &flags);
+ spin_lock_irqsave(&lp->spinlock, flags);
psa.psa_quality_thr = *(extra) & 0x0F;
psa_write(dev,
psa.psa_quality_thr);
/* Enable interrupts and restore flags. */
- wv_splx(lp, &flags);
+ spin_unlock_irqrestore(&lp->spinlock, flags);
return 0;
}
unsigned long flags;
/* Disable interrupts and save flags. */
- wv_splhi(lp, &flags);
+ spin_lock_irqsave(&lp->spinlock, flags);
psa_read(dev,
(char *) &psa.psa_quality_thr - (char *) &psa,
*(extra) = psa.psa_quality_thr & 0x0F;
/* Enable interrupts and restore flags. */
- wv_splx(lp, &flags);
+ spin_unlock_irqrestore(&lp->spinlock, flags);
return 0;
}
unsigned long flags;
/* Disable interrupts and save flags. */
- wv_splhi(lp, &flags);
+ spin_lock_irqsave(&lp->spinlock, flags);
/* Note : should check if user == root */
if(do_roaming && (*extra)==0)
do_roaming = (*extra);
/* Enable interrupts and restore flags. */
- wv_splx(lp, &flags);
+ spin_unlock_irqrestore(&lp->spinlock, flags);
return 0;
}
#endif
/* Disable interrupts & save flags */
- wv_splhi(lp, &flags);
+ spin_lock_irqsave(&lp->spinlock, flags);
wstats = &lp->wstats;
wstats->discard.misc = 0L;
/* ReEnable interrupts & restore flags */
- wv_splx(lp, &flags);
+ spin_unlock_irqrestore(&lp->spinlock, flags);
#ifdef DEBUG_IOCTL_TRACE
printk(KERN_DEBUG "%s: <-wavelan_get_wireless_stats()\n", dev->name);
printk(KERN_DEBUG "%s: ->wv_packet_write(%d)\n", dev->name, length);
#endif
- wv_splhi(lp, &flags);
+ spin_lock_irqsave(&lp->spinlock, flags);
/* Check if we need some padding */
if(clen < ETH_ZLEN)
/* Keep stats up to date */
lp->stats.tx_bytes += length;
- wv_splx(lp, &flags);
+ spin_unlock_irqrestore(&lp->spinlock, flags);
#ifdef DEBUG_TX_INFO
wv_packet_info((u_char *) buf, length, dev->name, "wv_packet_write");
* we can do it now */
if(lp->reconfig_82593)
{
- wv_splhi(lp, &flags); /* Disable interrupts */
+ spin_lock_irqsave(&lp->spinlock, flags); /* Disable interrupts */
wv_82593_config(dev);
- wv_splx(lp, &flags); /* Re-enable interrupts */
+ spin_unlock_irqrestore(&lp->spinlock, flags); /* Re-enable interrupts */
/* Note : the configure procedure was totally synchronous,
* so the Tx buffer is now free */
}
printk(KERN_DEBUG "%s: ->wv_ru_stop()\n", dev->name);
#endif
- wv_splhi(lp, &flags);
+ spin_lock_irqsave(&lp->spinlock, flags);
/* First, send the LAN controller a stop receive command */
wv_82593_cmd(dev, "wv_graceful_shutdown(): stop-rcv",
}
while(((status & SR3_EXEC_STATE_MASK) != SR3_EXEC_IDLE) && (spin-- > 0));
- wv_splx(lp, &flags);
+ spin_unlock_irqrestore(&lp->spinlock, flags);
/* If there was a problem */
if(spin <= 0)
if(!wv_ru_stop(dev))
return FALSE;
- wv_splhi(lp, &flags);
+ spin_lock_irqsave(&lp->spinlock, flags);
/* Now we know that no command is being executed. */
}
#endif
- wv_splx(lp, &flags);
+ spin_unlock_irqrestore(&lp->spinlock, flags);
#ifdef DEBUG_CONFIG_TRACE
printk(KERN_DEBUG "%s: <-wv_ru_start()\n", dev->name);
return FALSE;
/* Disable interrupts */
- wv_splhi(lp, &flags);
+ spin_lock_irqsave(&lp->spinlock, flags);
/* Disguised goto ;-) */
do
while(0);
/* Re-enable interrupts */
- wv_splx(lp, &flags);
+ spin_unlock_irqrestore(&lp->spinlock, flags);
#ifdef DEBUG_CONFIG_TRACE
printk(KERN_DEBUG "%s: <-wv_hw_config()\n", dev->name);
/* Prevent reentrancy. We need to do that because we may have
* multiple interrupt handler running concurently.
- * It is safe because wv_splhi() disable interrupts before aquiring
+ * It is safe because interrupts are disabled before aquiring
* the spinlock. */
spin_lock(&lp->spinlock);
dev->name);
#endif
- wv_splhi(lp, &flags);
+ spin_lock_irqsave(&lp->spinlock, flags);
/* Ask to abort the current command */
outb(OP0_ABORT, LCCR(base));
aborted = TRUE;
/* Release spinlock here so that wv_hw_reset() can grab it */
- wv_splx(lp, &flags);
+ spin_unlock_irqrestore(&lp->spinlock, flags);
/* Check if we were successful in aborting it */
if(!aborted)