Skip to contentSkip to conversation

ipwireless: driver for 3G PC Card

PATCH In review David Sterba 5 participants 10 messages Feb 1, 2008 – Feb 7, 2008 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

PATCH v4 1/1 ipwireless: driver for 3G PC Card

Hi,

hope this is last round. Latest changes were mostly in coding style, one minor bugfix.

Please apply.

David Sterba
---
From: David Sterba <[email protected]>

ipwireless: driver for PC Card, 3G internet connection

The driver is manufactured by IPWireless.

---
 MAINTAINERS                                     |    8 
 drivers/char/pcmcia/Kconfig                     |    9 
 drivers/char/pcmcia/Makefile                    |    2 
 drivers/char/pcmcia/ipwireless/Makefile         |   10 
 drivers/char/pcmcia/ipwireless/hardware.c       | 1787 ++++++++++++++++++++++++
 drivers/char/pcmcia/ipwireless/hardware.h       |   64 
 drivers/char/pcmcia/ipwireless/main.c           |  506 ++++++
 drivers/char/pcmcia/ipwireless/main.h           |   70 
 drivers/char/pcmcia/ipwireless/network.c        |  512 ++++++
 drivers/char/pcmcia/ipwireless/network.h        |   55 
 drivers/char/pcmcia/ipwireless/setup_protocol.h |  108 +
 drivers/char/pcmcia/ipwireless/tty.c            |  688 +++++++++
 drivers/char/pcmcia/ipwireless/tty.h            |   48 
 13 files changed, 3867 insertions(+)

---

MAINTAINERS +8 -0
index df40a4e..fc01a22 100644
@@ -2007,6 +2007,14 @@ M:	[email protected]
 L:	[email protected]
 S:	Maintained
 
+IPWIRELES DRIVER
+P:	Jiri Kosina
+M:	[email protected]
+P:	David Sterba
+M:	[email protected]
+S:	Maintained
+T:	git://git.kernel.org/pub/scm/linux/kernel/git/jikos/ipwireless_cs.git
+
 IRDA SUBSYSTEM
 P:	Samuel Ortiz
 M:	[email protected]
drivers/char/pcmcia/Kconfig +9 -0
index f25facd..00b8a84 100644
@@ -43,5 +43,14 @@ config CARDMAN_4040
 	  (http://www.omnikey.com/), or a current development version of OpenCT
 	  (http://www.opensc.org/).
 
+config IPWIRELESS
+	tristate "IPWireless 3G UMTS PCMCIA card support"
+	depends on PCMCIA
+	select PPP
+	help
+	  This is a driver for 3G UMTS PCMCIA card from IPWireless company. In
+	  some countries (for example Czech Republic, T-Mobile ISP) this card
+	  is shipped for service called UMTS 4G.
+
 endmenu
 
drivers/char/pcmcia/Makefile +2 -0
index 0aae209..be8f287 100644
@@ -4,6 +4,8 @@
 # Makefile for the Linux PCMCIA char device drivers.
 #
 
+obj-y += ipwireless/
+
 obj-$(CONFIG_SYNCLINK_CS) += synclink_cs.o
 obj-$(CONFIG_CARDMAN_4000) += cm4000_cs.o
 obj-$(CONFIG_CARDMAN_4040) += cm4040_cs.o
drivers/char/pcmcia/ipwireless/Makefile new file +10 -0
new file mode 100644
index 0000000..b71eb59
@@ -0,0 +1,10 @@
+#
+# drivers/char/pcmcia/ipwireless/Makefile
+#
+# Makefile for the IPWireless driver
+#
+
+obj-$(CONFIG_IPWIRELESS) += ipwireless.o
+
+ipwireless-objs := hardware.o main.o network.o tty.o
+
drivers/char/pcmcia/ipwireless/hardware.c new file +1787 -0

1,787 lines not on this page · raw message

drivers/char/pcmcia/ipwireless/hardware.h new file +64 -0

64 lines not on this page · raw message

drivers/char/pcmcia/ipwireless/main.c new file +506 -0

506 lines not on this page · raw message

drivers/char/pcmcia/ipwireless/main.h new file +70 -0

70 lines not on this page · raw message

drivers/char/pcmcia/ipwireless/network.c new file +512 -0

512 lines not on this page · raw message

drivers/char/pcmcia/ipwireless/network.h new file +55 -0

15 lines not on this page · raw message

drivers/char/pcmcia/ipwireless/setup_protocol.h new file +108 -0

108 lines not on this page · raw message

drivers/char/pcmcia/ipwireless/tty.c new file +688 -0

688 lines not on this page · raw message

drivers/char/pcmcia/ipwireless/tty.h new file +48 -0

48 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Part of the diff is not shown here. View the raw message.

#1 lore raw

Hi David,

drivers/char/pcmcia/ipwireless/hardware.c line 1242

Quoted 9 lines
drivers/char/pcmcia/ipwireless/hardware.c new file +9 -0
+irqreturn_t ipwireless_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+{
+	struct ipw_hardware *hw = dev_id;
+
+	if (hw->hw_version == HW_VERSION_1)
+		return ipwireless_handle_v1_interrupt(irq, hw);
+	else
+		return ipwireless_handle_v2_v3_interrupt(irq, hw);
+}

why is this not static? I think the interrupt routine should be in the file where you actually claim the interrupt.

drivers/char/pcmcia/ipwireless/hardware.c line 1787

Quoted 9 lines
drivers/char/pcmcia/ipwireless/hardware.c new file +9 -0
+/*
+ * Associate the specified network with this hardware, so it will receive events
+ * from it.
+ */
+void ipwireless_associate_network(struct ipw_hardware *hw,
+				  struct ipw_network *network)
+{
+	hw->network = network;
+}

I think a #define would be simpler in this case.

drivers/char/pcmcia/ipwireless/main.c line 60

Quoted 5 lines
drivers/char/pcmcia/ipwireless/main.c new file +5 -0
+module_param(tty_major, int, 0);
+module_param_named(debug, ipwireless_debug, int, 0);
+module_param_named(loopback, ipwireless_loopback, int, 0);
+module_param_named(out_queue, ipwireless_out_queue, int, 0);
+MODULE_PARM_DESC(tty_major, "ttyIPWp major number [0]");

Why is allowing to change the major still needed. I think we passed the bridge of the need for static numbers a long long long time ago.

Quoted 1 line

+static const char drv_name[] = IPWIRELESS_PCCARD_NAME;

This looks useless to. Do we need that?

Regards

Marcel

#2 lore raw

Hi,

Quoted 4 lines
Quoted 4 lines

+irqreturn_t ipwireless_interrupt(int irq, void *dev_id, struct pt_regs *regs) +{

drivers/char/pcmcia/ipwireless/hardware.c new file +2 -0
+	struct ipw_hardware *hw = dev_id;
+
Quoted 8 lines

drivers/char/pcmcia/ipwireless/hardware.c line 1242

Quoted 5 lines
drivers/char/pcmcia/ipwireless/hardware.c new file +5 -0
+	if (hw->hw_version == HW_VERSION_1)
+		return ipwireless_handle_v1_interrupt(irq, hw);
+	else
+		return ipwireless_handle_v2_v3_interrupt(irq, hw);
+}

why is this not static? I think the interrupt routine should be in the file where you actually claim the interrupt.

This is due to current separation into files. hardware.c has many functions for handler bodies, while main.c registers the pcmcia structs in module init (and takes address of ipwireless_interrupt()). Long ago, the driver was one large file, and I don't want to merge the files back just to make some funcs static (and make the sources less readable).

Quoted 12 lines

drivers/char/pcmcia/ipwireless/hardware.c line 1787

Quoted 10 lines

+/*
+ * Associate the specified network with this hardware, so it will receive events + * from it.
+ */

drivers/char/pcmcia/ipwireless/hardware.c new file +5 -0
+void ipwireless_associate_network(struct ipw_hardware *hw,
+				  struct ipw_network *network)
+{
+	hw->network = network;
+}

I think a #define would be simpler in this case.

Same reason, the macro would be used in a file where the struct is not yet defined.

Quoted 8 lines

drivers/char/pcmcia/ipwireless/main.c line 60

Quoted 5 lines
drivers/char/pcmcia/ipwireless/main.c new file +5 -0
+module_param(tty_major, int, 0);
+module_param_named(debug, ipwireless_debug, int, 0);
+module_param_named(loopback, ipwireless_loopback, int, 0);
+module_param_named(out_queue, ipwireless_out_queue, int, 0);
+MODULE_PARM_DESC(tty_major, "ttyIPWp major number [0]");

Why is allowing to change the major still needed. I think we passed the bridge of the need for static numbers a long long long time ago.

Sounds reasonable. I personally haven't used this param (besides testing the code) and don't know of any related problems.

Quoted 3 lines
Quoted 1 line

+static const char drv_name[] = IPWIRELESS_PCCARD_NAME;

This looks useless to. Do we need that?

Removed. Used only in one place.

Thanks for comments. Updated version 5 will follow.

Dave

#3 lore raw
In reply to David Sterba
Quoted 2 lines · David Sterba

From: David Sterba <[email protected]>
ipwireless: driver for PC Card, 3G internet connection

Linus, as there is no PCMCIA maintainer and akpm apparently wants you to merge this directly [1] -- what is your position on this one please? As far as I can see all the major issues that were raised during review were fixed by David, so there shouldn't be any obstacles to merging it. It would be nice if this driver will make it for 2.6.25 merge window.

Thanks,

[1] http://lkml.org/lkml/2007/12/17/302

Signature · 1 line
Jiri Kosina
#4 lore raw

Hi Jiri,

Quoted 8 lines
Quoted 2 lines

From: David Sterba <[email protected]>
ipwireless: driver for PC Card, 3G internet connection

Linus, as there is no PCMCIA maintainer and akpm apparently wants you to merge this directly [1] -- what is your position on this one please? As far as I can see all the major issues that were raised during review were fixed by David, so there shouldn't be any obstacles to merging it. It would be nice if this driver will make it for 2.6.25 merge window.

I had some minor additional questions, but in general, I second that this driver should be merged for 2.6.25.

The question of the PCMCIA maintainership came up on a different mailing list. Personally I think that PCMCIA is a dead technology, but in some industrial environments this will live longer than expected. I would simply propose that LKML is used for PCMCIA related review and -mm for testing.

Regards

Marcel

#5 lore raw
Quoted 6 lines · Marcel Holtmann

I had some minor additional questions, but in general, I second that this driver should be merged for 2.6.25.

The question of the PCMCIA maintainership came up on a different mailing list.

Well, in the case of this particular driver, I think it's not so much a PCMCIA thing as a "network driver" thing. It's not like the driver actually needs any extra PCMCIA support or anything like that, and as such I think in this case it's really more of a regular network driver than anything else.

And especially with wireless, I think the impact for any future changes are about the wireless infrastructure, not PCMCIA. There's little reason to believe that we'll ever make any big PCMCIA overhauls exctly because PCMCIA is so dead.

So I'd happily merge it, but I would be even happier if I got ack's from the wireless people or if it was simply merged that way too.

Linus

#6 lore raw
Quoted 6 lines · Linus Torvalds

And especially with wireless, I think the impact for any future changes are about the wireless infrastructure, not PCMCIA. There's little reason to believe that we'll ever make any big PCMCIA overhauls exctly because PCMCIA is so dead. So I'd happily merge it, but I would be even happier if I got ack's from the wireless people or if it was simply merged that way too.

Unfortunately the device has quite confusing name (and the driver of course follows). It has 'wireless' in its name, but it has literally nothing to do with "wireless" networking, as long as 802.11<anything> is involved.

It is in fact a PCMCIA card, that acts as a GPRS/EDGE/UMTS modem. So its This has been already discussed, please see
http://www.ussg.iu.edu/hypermail/linux/kernel/0711.3/2198.html

Thanks,

Signature · 2 lines
Jiri Kosina
SUSE Labs
#7 lore raw

Baa Baa (a Kiwi greeting :) ),

I have to second Jiri on this one. The card is used as a 'WAN' technology not a 'LAN' technology platform and hence does not really fit into the 'wireless 802.11<anything>' space. I think that it should be merged in where it currently sits.

~benm

-----Original Message-----
From: Jiri Kosina [mailto:[email protected]]
Sent: Wednesday, 6 February 2008 1:15 p.m.
To: Linus Torvalds
Cc: Marcel Holtmann; David Sterba; [email protected]; Ben Martel; [email protected]
Subject: Re: [PATCH][v4] ipwireless: driver for 3G PC Card

Quoted 1 line · Linus Torvalds

And especially with wireless, I think the impact for any future

changes

Quoted 1 line

are about the wireless infrastructure, not PCMCIA. There's little

reason

Quoted 1 line

to believe that we'll ever make any big PCMCIA overhauls exctly

because

Quoted 1 line

PCMCIA is so dead. So I'd happily merge it, but I would be even

happier

Quoted 1 line

if I got ack's from the wireless people or if it was simply merged

that

Quoted 1 line

way too.

Unfortunately the device has quite confusing name (and the driver of course follows). It has 'wireless' in its name, but it has literally nothing to do with "wireless" networking, as long as 802.11<anything> is

involved.

It is in fact a PCMCIA card, that acts as a GPRS/EDGE/UMTS modem. So its

This has been already discussed, please see
http://www.ussg.iu.edu/hypermail/linux/kernel/0711.3/2198.html

Thanks,

Signature · 7 lines
Jiri Kosina
SUSE Labs

Internal Virus Database is out-of-date.
Checked by AVG Free Edition. 
Version: 7.5.503 / Virus Database: 269.16.4/1147 - Release Date:
23/11/2007 9:19 a.m.
#8 lore raw
In reply to Linus Torvalds

Hi,

updated to v5.

Changes:
- minor cleanups
- removed modparam for static tty major assignment

Please apply.

David Sterba
---
From: David Sterba <[email protected]>

ipwireless: driver for PC Card, 3G internet connection

The device is manufactured by IPWireless.

---
 MAINTAINERS                                     |    8 
 drivers/char/pcmcia/Kconfig                     |    9 
 drivers/char/pcmcia/Makefile                    |    2 
 drivers/char/pcmcia/ipwireless/Makefile         |   10 
 drivers/char/pcmcia/ipwireless/hardware.c       | 1787 ++++++++++++++++++++++++
 drivers/char/pcmcia/ipwireless/hardware.h       |   64 
 drivers/char/pcmcia/ipwireless/main.c           |  501 ++++++
 drivers/char/pcmcia/ipwireless/main.h           |   70 
 drivers/char/pcmcia/ipwireless/network.c        |  512 ++++++
 drivers/char/pcmcia/ipwireless/network.h        |   55 
 drivers/char/pcmcia/ipwireless/setup_protocol.h |  108 +
 drivers/char/pcmcia/ipwireless/tty.c            |  688 +++++++++
 drivers/char/pcmcia/ipwireless/tty.h            |   48 
 13 files changed, 3862 insertions(+)

---

MAINTAINERS +8 -0
index df40a4e..fc01a22 100644
@@ -2007,6 +2007,14 @@ M:	[email protected]
 L:	[email protected]
 S:	Maintained
 
+IPWIRELES DRIVER
+P:	Jiri Kosina
+M:	[email protected]
+P:	David Sterba
+M:	[email protected]
+S:	Maintained
+T:	git://git.kernel.org/pub/scm/linux/kernel/git/jikos/ipwireless_cs.git
+
 IRDA SUBSYSTEM
 P:	Samuel Ortiz
 M:	[email protected]
drivers/char/pcmcia/Kconfig +9 -0
index f25facd..00b8a84 100644
@@ -43,5 +43,14 @@ config CARDMAN_4040
 	  (http://www.omnikey.com/), or a current development version of OpenCT
 	  (http://www.opensc.org/).
 
+config IPWIRELESS
+	tristate "IPWireless 3G UMTS PCMCIA card support"
+	depends on PCMCIA
+	select PPP
+	help
+	  This is a driver for 3G UMTS PCMCIA card from IPWireless company. In
+	  some countries (for example Czech Republic, T-Mobile ISP) this card
+	  is shipped for service called UMTS 4G.
+
 endmenu
 
drivers/char/pcmcia/Makefile +2 -0
index 0aae209..be8f287 100644
@@ -4,6 +4,8 @@
 # Makefile for the Linux PCMCIA char device drivers.
 #
 
+obj-y += ipwireless/
+
 obj-$(CONFIG_SYNCLINK_CS) += synclink_cs.o
 obj-$(CONFIG_CARDMAN_4000) += cm4000_cs.o
 obj-$(CONFIG_CARDMAN_4040) += cm4040_cs.o
drivers/char/pcmcia/ipwireless/Makefile new file +10 -0
new file mode 100644
index 0000000..b71eb59
@@ -0,0 +1,10 @@
+#
+# drivers/char/pcmcia/ipwireless/Makefile
+#
+# Makefile for the IPWireless driver
+#
+
+obj-$(CONFIG_IPWIRELESS) += ipwireless.o
+
+ipwireless-objs := hardware.o main.o network.o tty.o
+
drivers/char/pcmcia/ipwireless/hardware.c new file +1787 -0

1,787 lines not on this page · raw message

drivers/char/pcmcia/ipwireless/hardware.h new file +64 -0

64 lines not on this page · raw message

drivers/char/pcmcia/ipwireless/main.c new file +501 -0

501 lines not on this page · raw message

drivers/char/pcmcia/ipwireless/main.h new file +70 -0

70 lines not on this page · raw message

drivers/char/pcmcia/ipwireless/network.c new file +512 -0

512 lines not on this page · raw message

drivers/char/pcmcia/ipwireless/network.h new file +55 -0

20 lines not on this page · raw message

drivers/char/pcmcia/ipwireless/setup_protocol.h new file +108 -0

108 lines not on this page · raw message

drivers/char/pcmcia/ipwireless/tty.c new file +688 -0

688 lines not on this page · raw message

drivers/char/pcmcia/ipwireless/tty.h new file +48 -0

48 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Part of the diff is not shown here. View the raw message.

#9 lore raw
Quoted 7 lines · David Sterba

updated to v5.

Changes:
- minor cleanups
- removed modparam for static tty major assignment Please apply.
David Sterba

Linus -- as there are no other pending objections to the code so far, and I think we agreed that this has nothing to do neither with wireless tree, nor with networking drivers in general (it is basically a PCMCIA serial driver, and thus there is no relevant maintainer alive), would you please consider merging it for 2.6.25?

David, thanks a lot for taking care of another respin.

Thanks,

Signature · 1 line
Jiri Kosina