Skip to contentSkip to conversation

ipwireless_cs driver for 4G PC Card

PATCH In review David Sterba 7 participants 14 messages Nov 30, 2007 – Dec 17, 2007 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ipwireless_cs driver for 4G PC Card

Hi,

I'm submitting driver for IPWireless PC Card, used for 4G internet connection.
The driver has been in -mm series as ipwireless_cs.git tree for some time, is actively used and there are currently no outstanding bugs.

I'd like to let the driver pass through LKML and then let it queue for 2.6.25.

Driver is released under GPL, original authorship belongs to Symmetric co. Jiri Kosina has fixed some bugs and made it work with recent kernels, and I work on improving the code to match linux kernel standards.

When merged, please drop ipwireless_cs.git tree from -mm and include the patch instead. Patches should be sent to me and I'll push them to mainline via Jeff Garzik's driver tree, if there's no objection.

Driver lives in drivers/char/pcmcia directory, it's a serial driver. I'm not sure if this is the right place, since it's a networking driver too and therefore should be in drivers/net/pcmcia.

There will be a wiki with info for users and developers, todo etc.

Regards,
David Sterba

---
 MAINTAINERS                                        |    8 
 drivers/char/pcmcia/Kconfig                        |    8 
 drivers/char/pcmcia/Makefile                       |    4 
 drivers/char/pcmcia/ipwireless_cs_hardware.c       | 1728 +++++++++++++++++++++
 drivers/char/pcmcia/ipwireless_cs_hardware.h       |   63 
 drivers/char/pcmcia/ipwireless_cs_main.c           |  479 +++++
 drivers/char/pcmcia/ipwireless_cs_main.h           |   70 
 drivers/char/pcmcia/ipwireless_cs_network.c        |  496 ++++++
 drivers/char/pcmcia/ipwireless_cs_network.h        |   54 
 drivers/char/pcmcia/ipwireless_cs_setup_protocol.h |  108 +
 drivers/char/pcmcia/ipwireless_cs_tty.c            |  779 +++++++++
 drivers/char/pcmcia/ipwireless_cs_tty.h            |   48 
 12 files changed, 3845 insertions(+)

---

MAINTAINERS +8 -0
index df40a4e..a38e94a 100644
@@ -2007,6 +2007,14 @@ M:	[email protected]
 L:	[email protected]
 S:	Maintained
 
+IPWIRELESS_CS 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 +8 -0
index f25facd..2db3aac 100644
@@ -42,6 +42,14 @@ config CARDMAN_4040
 	  PC/SC ifdhandler provided from the Omnikey homepage
 	  (http://www.omnikey.com/), or a current development version of OpenCT
 	  (http://www.opensc.org/).
+config IPWIRELESS_CS
+	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 +4 -0
index 0aae209..f59c399 100644
@@ -4,6 +4,10 @@
 # Makefile for the Linux PCMCIA char device drivers.
 #
 
+ipwireless_cs-objs	:= ipwireless_cs_hardware.o ipwireless_cs_main.o ipwireless_cs_network.o ipwireless_cs_tty.o
+
 obj-$(CONFIG_SYNCLINK_CS) += synclink_cs.o
 obj-$(CONFIG_CARDMAN_4000) += cm4000_cs.o
 obj-$(CONFIG_CARDMAN_4040) += cm4040_cs.o
+obj-$(CONFIG_IPWIRELESS_CS) += ipwireless_cs.o
+
drivers/char/pcmcia/ipwireless_cs_hardware.c new file +1728 -0

1,728 lines not on this page · raw message

drivers/char/pcmcia/ipwireless_cs_hardware.h new file +63 -0

63 lines not on this page · raw message

drivers/char/pcmcia/ipwireless_cs_main.c new file +479 -0

479 lines not on this page · raw message

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

70 lines not on this page · raw message

drivers/char/pcmcia/ipwireless_cs_network.c new file +496 -0

496 lines not on this page · raw message

drivers/char/pcmcia/ipwireless_cs_network.h new file +54 -0

54 lines not on this page · raw message

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

72 lines not on this page · raw message

drivers/char/pcmcia/ipwireless_cs_tty.c new file +779 -0

779 lines not on this page · raw message

drivers/char/pcmcia/ipwireless_cs_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

On Fri, 30 Nov 2007, David Sterba wrote:

...

Quoted 4 lines
 drivers/char/pcmcia/Kconfig                        |    8
 drivers/char/pcmcia/Makefile                       |    4
 drivers/char/pcmcia/ipwireless_cs_hardware.c       | 1728 +++++++++++++++++++++
 drivers/char/pcmcia/ipwireless_cs_hardware.h       |   63
Quoted 8 lines
 drivers/char/pcmcia/ipwireless_cs_main.c           |  479 +++++
 drivers/char/pcmcia/ipwireless_cs_main.h           |   70
 drivers/char/pcmcia/ipwireless_cs_network.c        |  496 ++++++
 drivers/char/pcmcia/ipwireless_cs_network.h        |   54
 drivers/char/pcmcia/ipwireless_cs_setup_protocol.h |  108 +
 drivers/char/pcmcia/ipwireless_cs_tty.c            |  779 +++++++++
 drivers/char/pcmcia/ipwireless_cs_tty.h            |   48
 12 files changed, 3845 insertions(+)

might it not make more sense to put all of that into a new subdirectory, say, /drivers/char/pcmcia/ipwireless_cs? that way, it's more modular and it will keep that higher-level directory from potentially getting cluttered with even more drivers. and it would let you drop the pointless "ipwireless_cs_" prefix from all of those files as well.

rday

========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry Waterloo, Ontario, CANADA

http://crashcourse.ca
========================================================================

#2 lore raw

Hi,

Quoted 6 lines

might it not make more sense to put all of that into a new subdirectory, say, /drivers/char/pcmcia/ipwireless_cs? that way, it's more modular and it will keep that higher-level directory from potentially getting cluttered with even more drivers. and it would let you drop the pointless "ipwireless_cs_" prefix from all of those files as well.

ok, will put it into ipwireless, and the _cs suffix will go away as suggested elsewhere. The filenames will then get very generic names, do you have suggestion for better names? There are many drivers in own directory and files inside have the same prefix. Maybe we can use names like ipw-hw.c, etc.

Dave

#3 lore raw

Hi David,

Quoted 11 lines
Quoted 6 lines

might it not make more sense to put all of that into a new subdirectory, say, /drivers/char/pcmcia/ipwireless_cs? that way, it's more modular and it will keep that higher-level directory from potentially getting cluttered with even more drivers. and it would let you drop the pointless "ipwireless_cs_" prefix from all of those files as well.

ok, will put it into ipwireless, and the _cs suffix will go away as suggested elsewhere. The filenames will then get very generic names, do you have suggestion for better names? There are many drivers in own directory and files inside have the same prefix. Maybe we can use names like ipw-hw.c, etc.

don't use "ipw" as prefix. It is too close to the Intel wireless drivers and will only create confusion. The generic filenames in a subdirectory don't matter. The module name is what counts.

Regards

Marcel

#4 lore raw
In reply to David Sterba
Quoted 7 lines · David Sterba

Hi,

I'm submitting driver for IPWireless PC Card, used for 4G internet connection.
The driver has been in -mm series as ipwireless_cs.git tree for some time, is actively used and there are currently no outstanding bugs.

Almost :).

[...]

Quoted 1 line

[...]

Quoted 5 lines
drivers/char/pcmcia/ipwireless_cs_hardware.c new file +0 -0
new file mode 100644
index 0000000..d67ce2e

[...]

Quoted 22 lines
drivers/char/pcmcia/ipwireless_cs_hardware.c new file +22 -0
+static struct ipw_rx_packet *pool_allocate(struct ipw_hardware *hw,
+					   struct ipw_rx_packet *packet,
+					   int minimum_free_space)
+{
+
+	if (!packet) {
+		unsigned long flags;
+
+		/*
+		 * If this is the first fragment, then we will need to fetch a
+		 * packet to put it in.
+		 */
+		spin_lock_irqsave(&hw->spinlock, flags);
+		/* If we have one in our pool, then pull it out. */
+		if (!list_empty(&hw->rx_pool)) {
+			packet = list_first_entry(&hw->rx_pool,
+					struct ipw_rx_packet, queue);
+			list_del(&packet->queue);
+			hw->rx_pool_size--;
+			spin_unlock_irqrestore(&hw->spinlock, flags);
+		} else {
+			/* Otherwise allocate a new one. */

drivers/char/pcmcia/ipwireless_cs_hardware.c line 598

Quoted 10 lines
drivers/char/pcmcia/ipwireless_cs_hardware.c new file +10 -0
+			static int min_capacity = 256;
+			int new_capacity;
+
+			spin_unlock_irqrestore(&hw->spinlock, flags);
+			new_capacity =
+			    minimum_free_space > min_capacity
+			    ? minimum_free_space
+			    : min_capacity;
+			packet = kmalloc(sizeof(struct ipw_rx_packet)
+					+ new_capacity, GFP_ATOMIC);

These not-testing-alloc-retvals remain unresolved. Please post a -fix or patch v2 if any other comments come.

drivers/char/pcmcia/ipwireless_cs_hardware.c line 599

Quoted 1 line
drivers/char/pcmcia/ipwireless_cs_hardware.c new file +1 -0
+			packet->capacity = new_capacity;

...

thanks.

#5 lore raw
In reply to David Sterba
Quoted 21 lines · David Sterba

Hi,

I'm submitting driver for IPWireless PC Card, used for 4G internet connection.
The driver has been in -mm series as ipwireless_cs.git tree for some time, is actively used and there are currently no outstanding bugs.

I'd like to let the driver pass through LKML and then let it queue for 2.6.25.

Driver is released under GPL, original authorship belongs to Symmetric co. Jiri Kosina has fixed some bugs and made it work with recent kernels, and I work on improving the code to match linux kernel standards.

When merged, please drop ipwireless_cs.git tree from -mm and include the patch instead. Patches should be sent to me and I'll push them to mainline via Jeff Garzik's driver tree, if there's no objection.

Quoted 6 lines

Driver lives in drivers/char/pcmcia directory, it's a serial driver. I'm not sure if this is the right place, since it's a networking driver too and therefore should be in drivers/net/pcmcia.

There will be a wiki with info for users and developers, todo etc.

If the -main- purpose of the hardware is wireless, it should go in via John Linville, wireless maintainer...

Jeff

#6 lore raw
Quoted 5 lines · Jeff Garzik
Quoted 3 lines

Driver lives in drivers/char/pcmcia directory, it's a serial driver. I'm not sure if this is the right place, since it's a networking driver too and therefore should be in drivers/net/pcmcia.

If the -main- purpose of the hardware is wireless, it should go in via John Linville, wireless maintainer...

Well, it is

- 4G UMTS PPP networking hardware
- PCMCIA
- which presents itself as a serial character device (i.e. looks like usual modem to userspace, accepts AT commands, etc)

So my opinion is that it's very far away from what actually is in drivers/net/wireless. It's not 802.x network card in any sense.

Thanks,

Signature · 2 lines
Jiri Kosina
SUSE Labs
#7 lore raw
In reply to David Sterba

Hi David,

Quoted 34 lines

I'm submitting driver for IPWireless PC Card, used for 4G internet connection.
The driver has been in -mm series as ipwireless_cs.git tree for some time, is actively used and there are currently no outstanding bugs.

I'd like to let the driver pass through LKML and then let it queue for 2.6.25.

Driver is released under GPL, original authorship belongs to Symmetric co. Jiri Kosina has fixed some bugs and made it work with recent kernels, and I work on improving the code to match linux kernel standards.

When merged, please drop ipwireless_cs.git tree from -mm and include the patch instead. Patches should be sent to me and I'll push them to mainline via Jeff Garzik's driver tree, if there's no objection.

Driver lives in drivers/char/pcmcia directory, it's a serial driver. I'm not sure if this is the right place, since it's a networking driver too and therefore should be in drivers/net/pcmcia.

There will be a wiki with info for users and developers, todo etc.

Regards,
David Sterba

Quoted 14 lines
---
 MAINTAINERS                                        |    8 
 drivers/char/pcmcia/Kconfig                        |    8 
 drivers/char/pcmcia/Makefile                       |    4 
 drivers/char/pcmcia/ipwireless_cs_hardware.c       | 1728 +++++++++++++++++++++
 drivers/char/pcmcia/ipwireless_cs_hardware.h       |   63 
 drivers/char/pcmcia/ipwireless_cs_main.c           |  479 +++++
 drivers/char/pcmcia/ipwireless_cs_main.h           |   70 
 drivers/char/pcmcia/ipwireless_cs_network.c        |  496 ++++++
 drivers/char/pcmcia/ipwireless_cs_network.h        |   54 
 drivers/char/pcmcia/ipwireless_cs_setup_protocol.h |  108 +
 drivers/char/pcmcia/ipwireless_cs_tty.c            |  779 +++++++++
 drivers/char/pcmcia/ipwireless_cs_tty.h            |   48 
 12 files changed, 3845 insertions(+)

can we please drop the stupid "_cs" stuff. It is an old habit to have the shortcut for "Card Services" in the driver name, but that goes back to the time when the PCMCIA subsystem and its drivers were an external package. Especially in cases where only a PCMCIA card exists, it makes no sense anymore.

Regards

Marcel

#8 lore raw

Hi,

Quoted 5 lines

can we please drop the stupid "_cs" stuff. It is an old habit to have the shortcut for "Card Services" in the driver name, but that goes back to the time when the PCMCIA subsystem and its drivers were an external package. Especially in cases where only a PCMCIA card exists, it makes no sense anymore.

ok, will drop it, thanks.
Dave

#9 lore raw
In reply to David Sterba

Hi,

thank you all for your comments. Here comes updated version.

Changelog:
* files moved to ipwireless/, ipwireless_cs_ stripped from filenames
* _cs stripped from driver name
* kmalloc checks
* sync irq during shutdown
* removed /proc code, converted to module params

When merged, please drop ipwireless_cs.git tree from -mm and include the patch instead.

Regards,
David Sterba

---
 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(+)

---

MAINTAINERS +8 -0
index df40a4e..a38e94a 100644
@@ -2007,6 +2007,14 @@ M:	[email protected]
 L:	[email protected]
 S:	Maintained
 
+IPWIRELESS 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 +1784 -0

1,784 lines not on this page · raw message

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

63 lines not on this page · raw message

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

496 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 +513 -0

513 lines not on this page · raw message

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

28 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 +687 -0

687 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.

#10 lore raw

[ CC list trimmed ]

Quoted 18 lines · David Sterba

Changelog:
* files moved to ipwireless/, ipwireless_cs_ stripped from filenames
* _cs stripped from driver name
* kmalloc checks
* sync irq during shutdown
* removed /proc code, converted to module params

When merged, please drop ipwireless_cs.git tree from -mm and include the patch instead.

Regards,
David Sterba

Quoted 15 lines
---
 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(+)

Andrew, what is your position on merging this into your 2.6.25 queue please? David has fixed all the issues that came up during review, so it seems to be that it's time for the driver to be merged during the upcoming merge window.

If you take it, I am perfectly fine with you dropping the ipwireless_cs git tree from -mm lineup.

Thanks,

Signature · 2 lines
Jiri Kosina
SUSE Labs
#11 lore raw
Quoted 1 line · On Mon, 17 Dec 2007 11:57:46 +0100 (CET) Jiri Kosina <[email protected]> wrote:

[ CC list trimmed ]

often a bad idea...

Quoted 36 lines · David Sterba
Quoted 19 lines

Changelog:
* files moved to ipwireless/, ipwireless_cs_ stripped from filenames
* _cs stripped from driver name
* kmalloc checks
* sync irq during shutdown
* removed /proc code, converted to module params

When merged, please drop ipwireless_cs.git tree from -mm and include the patch instead.

Regards,
David Sterba

Quoted 15 lines
---
 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(+)
Quoted 8 lines

Andrew, what is your position on merging this into your 2.6.25 queue please? David has fixed all the issues that came up during review, so it seems to be that it's time for the driver to be merged during the upcoming merge window.

If you take it, I am perfectly fine with you dropping the ipwireless_cs git tree from -mm lineup.

I'd have thought that you'd merge it into git-ipwireless_cs.patch and that you would then take care of merging it into mainline at an appropriate time?

#12 lore raw
Quoted 8 lines · Andrew Morton
Quoted 5 lines

Andrew, what is your position on merging this into your 2.6.25 queue please? David has fixed all the issues that came up during review, so it seems to be that it's time for the driver to be merged during the upcoming merge window. If you take it, I am perfectly fine with you dropping the ipwireless_cs git tree from -mm lineup.

I'd have thought that you'd merge it into git-ipwireless_cs.patch and that you would then take care of merging it into mainline at an appropriate time?

I'd normally send this through PCMCIA maintainer's tree, but as long as there is no such thing, I thought that merging through you is the best thing to do. I don't want to bother Linus with pull request for a single new driver.

Thanks,

Signature · 2 lines
Jiri Kosina
SUSE Labs
#13 lore raw
Quoted 7 lines · On Mon, 17 Dec 2007 13:58:09 +0100 (CET) Jiri Kosina <[email protected]> wrote:
Quoted 5 lines · Andrew Morton
Quoted 5 lines

Andrew, what is your position on merging this into your 2.6.25 queue please? David has fixed all the issues that came up during review, so it seems to be that it's time for the driver to be merged during the upcoming merge window. If you take it, I am perfectly fine with you dropping the ipwireless_cs git tree from -mm lineup.

Quoted 9 lines
Quoted 3 lines

I'd have thought that you'd merge it into git-ipwireless_cs.patch and that you would then take care of merging it into mainline at an appropriate time?

I'd normally send this through PCMCIA maintainer's tree, but as long as there is no such thing, I thought that merging through you is the best thing to do. I don't want to bother Linus with pull request for a single new driver.

Linus will cope ;)

Assuming that you've reviewed the driver and have some understanding of what it does and how it does it, you're way ahead of me. Please go ahead and merge it when you think that is appropriate.