Re: [PATCH] ipwireless: driver for 3G PC Card

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Pavel Machek <pavel@...>
Cc: David Sterba <dsterba@...>, <torvalds@...>, <linux-kernel@...>, <jkosina@...>, <benm@...>
Date: Wednesday, January 30, 2008 - 5:29 pm

Pavel & all,


Pavel Machek wrote:

We should keep these names because they are part of the interface
between host and card defined by the manufacturer.
This code is obsolete (a workaround to an embedded system bug) and
should be removed - sorry I didn't step on it earlier.  It can removed
with minimal risk of destabilizing the driver.  It should look like this:

static irqreturn_t ipwireless_handle_v1_interrupt(int irq,
ipw_hardware_t *hw)
{
        u_short irqn;
        u_short ack;

        irqn = inw(hw->base_port + IOIR);

        if (irqn == (u_short) 0xFFFF)
                return IRQ_NONE;
        else if (irqn != 0) {
                ack = 0;
                /* Transmit complete. */
                if (irqn & IR_TXINTR) {
                        hw->tx_ready++;
                        ack |= IR_TXINTR;
                }

                /* Received data */
                if (irqn & IR_RXINTR) {
                        ack |= IR_RXINTR;
                        hw->rx_ready++;
                }
                if (ack != 0) {
                        outw(ack, hw->base_port + IOIR);

                        /* Perform the I/O retrieval in a tasklet,
because the ppp_generic
                           may be called from a tasklet, but not from a
hardware interrupt. */
                        if (!hw->tasklet_pending) {
                                hw->tasklet_pending = 1;
                                tasklet_schedule(&hw->tasklet);
                        }
                }
                return IRQ_HANDLED;
        } else
                return IRQ_NONE;

}

The v2_v3 handler should not have it either, and should start like this:

static irqreturn_t ipwireless_handle_v2_v3_interrupt(int irq,
ipw_hardware_t *hw)
{
    int tx = 0;
    int rx = 0;
    int rx_repeat = 0;
    int b_try_MemTX_OLD;
    do {
        u_short memtx = ioread16(hw->MemTX);
        u_short memtx_serial;
        u_short memrxdone = ioread16(&hw->memInfReg->MemRXDone);

        b_try_MemTX_OLD = 0;

        /* check whether the interrupt was generated by ipwireless card */
        if (!(memtx & MEMTX_TX) && !(memrxdone & MEMRX_RX_DONE))
            return IRQ_NONE;

        /* See if the card is physically present. Note that while it is
         * powering up, it appears not to be present. */
        if (ioread32(&hw->memInfReg->MemCardPresent) !=
CARD_PRESENT_VALUE) {
            u_short csr = ioread16(&hw->memCCR->PCCSR);
            csr &= 0xfffd;
            iowrite16(csr, &hw->memCCR->PCCSR);
            return IRQ_HANDLED;
        }

I don't think so, but I'm happy to be corrected.


Steve


--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] ipwireless: driver for 3G PC Card, David Sterba, (Mon Jan 28, 1:19 pm)
Re: [PATCH] ipwireless: driver for 3G PC Card, Pavel Machek, (Wed Jan 30, 9:40 am)
Re: [PATCH] ipwireless: driver for 3G PC Card, David Sterba, (Fri Feb 1, 11:21 am)
Re: [PATCH] ipwireless: driver for 3G PC Card, Pavel Machek, (Fri Feb 1, 7:43 pm)
Re: [PATCH] ipwireless: driver for 3G PC Card, Stephen Blackheath [to Foxconn]..., (Wed Jan 30, 5:29 pm)
Re: [PATCH] ipwireless: driver for 3G PC Card, Pavel Machek, (Wed Jan 30, 7:15 pm)
Re: [PATCH] ipwireless: driver for 3G PC Card, Randy Dunlap, (Mon Jan 28, 2:08 pm)
Re: [PATCH] ipwireless: driver for 3G PC Card, David Sterba, (Tue Jan 29, 9:40 am)
Re: [PATCH] ipwireless: driver for 3G PC Card, Jiri Slaby, (Mon Jan 28, 7:18 pm)
Re: [PATCH] ipwireless: driver for 3G PC Card, David Sterba, (Tue Jan 29, 9:42 am)
Re: [PATCH] ipwireless: driver for 3G PC Card, Randy Dunlap, (Mon Jan 28, 7:28 pm)
Re: [PATCH] ipwireless: driver for 3G PC Card, Jiri Slaby, (Mon Jan 28, 7:29 pm)
Re: [PATCH] ipwireless: driver for 3G PC Card, Randy Dunlap, (Mon Jan 28, 7:33 pm)
Re: [PATCH] ipwireless: driver for 3G PC Card, Pekka Enberg, (Tue Jan 29, 2:22 am)
Re: [PATCH] ipwireless: driver for 3G PC Card, Alexey Dobriyan, (Mon Jan 28, 1:53 pm)
Re: [PATCH] ipwireless: driver for 3G PC Card, Pavel Machek, (Wed Jan 30, 9:28 am)