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

Previous thread: git-x86 oopses in acpi_ps_peek_opcode by Andi Kleen on Monday, January 28, 2008 - 1:19 pm. (5 messages)

Next thread: Re: Problem with ata layer in 2.6.24 by Andrey Borzenkov on Monday, January 28, 2008 - 2:53 pm. (5 messages)
To: <torvalds@...>
Cc: <linux-kernel@...>, <jkosina@...>, <benm@...>, <stephen@...>
Date: Monday, January 28, 2008 - 1:19 pm

Hi Linus,

I'm submitting driver for IPWireless PC Card modem for inclusion to 2.6.25.

The driver has been in -mm series as ipwireless_cs.git tree for
some time and has passed through lkml (http://lkml.org/lkml/2007/12/12/165).
The PCMCIA subsystem is unmaintained, so I'm sending it directly as Andrew
suggested.

David Sterba
---
From: David Sterba <dsterba@suse.cz>

ipwireless: driver for PC Card, 3G internet connection

The driver is manufactured by IPWireless.

Rewieved-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Ben Martel <benm@symmetric.co.nz>
Signed-off-by: Stephen Blackheath <stephen@symmetric.co.nz>
Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
---
MAINTAINERS | 8
drivers/char/pcmcia/Kconfig | 9
drivers/char/pcmcia/Makefile | 2
drivers/char/pcmcia/ipwireless/Makefile | 10
drivers/char/pcmcia/ipwireless/hardware.c | 1784 ++++++++++++++++++++++++
drivers/char/pcmcia/ipwireless/hardware.h | 63
drivers/char/pcmcia/ipwireless/main.c | 496 ++++++
drivers/char/pcmcia/ipwireless/main.h | 70
drivers/char/pcmcia/ipwireless/network.c | 513 ++++++
drivers/char/pcmcia/ipwireless/network.h | 54
drivers/char/pcmcia/ipwireless/setup_protocol.h | 108 +
drivers/char/pcmcia/ipwireless/tty.c | 687 +++++++++
drivers/char/pcmcia/ipwireless/tty.h | 48
13 files changed, 3852 insertions(+)
---
diff --git a/MAINTAINERS b/MAINTAINERS
index df40a4e..a38e94a 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2007,6 +2007,14 @@ M: acme@ghostprotocols.net
L: netdev@vger.kernel.org
S: Maintained

+IPWIRELESS DRIVER
+P: Jiri Kosina
+M: jkosina@suse.cz
+P: David Sterba
+M: dsterba@suse.cz
+S: Maintained
+T: git://git.kernel.org/pub/scm/linux/kernel/git/jikos/ipwireless_cs.git
+
IRDA SUBSYSTEM
P: Samuel Orti...

To: David Sterba <dsterba@...>
Cc: <torvalds@...>, <linux-kernel@...>, <jkosina@...>, <benm@...>, <stephen@...>
Date: Wednesday, January 30, 2008 - 9:40 am

Could we get better names? PCIOB is cryptic, pci_io_base is pretty

Not sure how this is supposed to work. If you assume unshared
interrupts, it should be possible to return something and make core
care.

If you are assuming shared interrupts, either you should disable on
first 0xFFFF (are you sure cast is needed, btw?), or not at all,
because it could be the other device sedning you 100 of those...

...so which one is it?

Hiding structs BehindTypedefsIsEvil.

Pavel

--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--

To: Pavel Machek <pavel@...>
Cc: <torvalds@...>, <linux-kernel@...>, <jkosina@...>, <benm@...>, <stephen@...>
Date: Friday, February 1, 2008 - 11:21 am

Some items are set during initial phase and read only afterwards. This don't
need to be protected. Nevetheless, I've found some missing locking around

Unfortunatelly PCMCIA subsystem is full of these and all drivers use them.
I'll stay consistent for now.

Updated patch v4 will follow.

dave
--

To: David Sterba <dsterba@...>
Cc: <torvalds@...>, <linux-kernel@...>, <jkosina@...>, <benm@...>, <stephen@...>
Date: Friday, February 1, 2008 - 7:43 pm

can you remove bad_interrupt_count? It seems very random in presence

Thanks!
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--

To: Pavel Machek <pavel@...>
Cc: David Sterba <dsterba@...>, <torvalds@...>, <linux-kernel@...>, <jkosina@...>, <benm@...>
Date: Wednesday, January 30, 2008 - 5:29 pm

Pavel & all,

We should keep these names because they are part of the interface
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_...

To: Stephen Blackheath [to Foxconn] <stephen@...>
Cc: David Sterba <dsterba@...>, <torvalds@...>, <linux-kernel@...>, <jkosina@...>, <benm@...>
Date: Wednesday, January 30, 2008 - 7:15 pm

No. Use sensible names, and put manufacturer-defined 5-letter crap in
the comments. Heck, notice that they just took first letter of each

You have a structure, and are accessing its fields from interrupts. I
assume you access the fields outside interrupt, too? As the fields are
not of atomic_t, I believe you need locking.

(Oh, and I should have said that earlier: Thanks for the driver and
congratulations for getting it this far).
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--

To: <dsterba@...>
Cc: <torvalds@...>, <linux-kernel@...>, <jkosina@...>, <benm@...>, <stephen@...>
Date: Monday, January 28, 2008 - 2:08 pm

On Mon, 28 Jan 2008 18:19:29 +0100 David Sterba wrote:

From C99 spec:
"The order of allocation of bit-fields within a unit (high-order to
low-order or low-order to high-order) is implementation-defined."

so if the order/location of these bitfields is important (from one
system to another), you should use bit masks instead of bitfields

Need ":" and/or space between CARD_NAME and following string.

Will these parameters be documented anywhere?

---
~Randy
--

To: Randy Dunlap <rdunlap@...>
Cc: <torvalds@...>, <linux-kernel@...>, <jkosina@...>, <benm@...>, <stephen@...>
Date: Tuesday, January 29, 2008 - 9:40 am

I've changed it to __BIG_ENDIAN_BITFIELDS, as suggested by Alexey. The order

The options are intended for debugging. Normal user does not need to tweak

Fixed.

Updated patch will follow.

Thank you for comments.

Dave

--

To: Randy Dunlap <rdunlap@...>
Cc: <dsterba@...>, <torvalds@...>, <linux-kernel@...>, <jkosina@...>, <benm@...>, <stephen@...>
Date: Monday, January 28, 2008 - 7:18 pm

Anyway the descs are wrong. Those 3 are for the only one variable.

--

To: Jiri Slaby <jirislaby@...>
Cc: Randy Dunlap <rdunlap@...>, <torvalds@...>, <linux-kernel@...>, <jkosina@...>, <benm@...>, <stephen@...>
Date: Tuesday, January 29, 2008 - 9:42 am

Well, I've removed them, this was not consistent neither within the driver nor

Yes this was my copy&paste error, thanks.

Dave
--

To: Jiri Slaby <jirislaby@...>
Cc: <dsterba@...>, <torvalds@...>, <linux-kernel@...>, <jkosina@...>, <benm@...>, <stephen@...>
Date: Monday, January 28, 2008 - 7:28 pm

Ack, thanks.

---
~Randy
--

To: Randy Dunlap <rdunlap@...>
Cc: <dsterba@...>, <torvalds@...>, <linux-kernel@...>, <jkosina@...>, <benm@...>, <stephen@...>
Date: Monday, January 28, 2008 - 7:29 pm

So then, what's the problem?
--

To: Jiri Slaby <jirislaby@...>
Cc: <dsterba@...>, <torvalds@...>, <linux-kernel@...>, <jkosina@...>, <benm@...>, <stephen@...>
Date: Monday, January 28, 2008 - 7:33 pm

Why is it there? We have a kernel documentation language.
Please use it or plain text.

---
~Randy
--

To: Randy Dunlap <rdunlap@...>
Cc: Jiri Slaby <jirislaby@...>, <dsterba@...>, <torvalds@...>, <linux-kernel@...>, <jkosina@...>, <benm@...>, <stephen@...>
Date: Tuesday, January 29, 2008 - 2:22 am

Hi,

Yes please.

Pekka
--

To: David Sterba <dsterba@...>
Cc: <torvalds@...>, <linux-kernel@...>, <jkosina@...>, <benm@...>, <stephen@...>
Date: Monday, January 28, 2008 - 1:53 pm

You want __BIG_ENDIAN_BITFIELD here.
--

To: Alexey Dobriyan <adobriyan@...>
Cc: David Sterba <dsterba@...>, <torvalds@...>, <linux-kernel@...>, <jkosina@...>, <benm@...>, <stephen@...>
Date: Wednesday, January 30, 2008 - 9:28 am

Actually, you probably want to avoid bitfields here, and just do bit
arithmetics by hand.
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--

Previous thread: git-x86 oopses in acpi_ps_peek_opcode by Andi Kleen on Monday, January 28, 2008 - 1:19 pm. (5 messages)

Next thread: Re: Problem with ata layer in 2.6.24 by Andrey Borzenkov on Monday, January 28, 2008 - 2:53 pm. (5 messages)