mirror of
https://github.com/Dasharo/linux.git
synced 2026-03-06 15:25:10 -08:00
ipwireless: driver for PC Card 3G/UMTS modem
The device is manufactured by IPWireless. In some countries (for example Czech Republic, T-Mobile ISP) this card is shipped for service called UMTS 4G. It's a piece of PCMCIA "4G" UMTS PPP networking hardware that presents itself as a serial character device (i.e. looks like usual modem to userspace, accepts AT commands, etc). 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> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
committed by
Linus Torvalds
parent
151db1fc23
commit
099dc4fb62
@@ -2150,6 +2150,14 @@ M: acme@ghostprotocols.net
|
||||
L: netdev@vger.kernel.org
|
||||
S: Maintained
|
||||
|
||||
IPWIRELES 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 Ortiz
|
||||
M: samuel@sortiz.org
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
10
drivers/char/pcmcia/ipwireless/Makefile
Normal file
10
drivers/char/pcmcia/ipwireless/Makefile
Normal file
@@ -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
|
||||
|
||||
1787
drivers/char/pcmcia/ipwireless/hardware.c
Normal file
1787
drivers/char/pcmcia/ipwireless/hardware.c
Normal file
File diff suppressed because it is too large
Load Diff
64
drivers/char/pcmcia/ipwireless/hardware.h
Normal file
64
drivers/char/pcmcia/ipwireless/hardware.h
Normal file
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
* IPWireless 3G PCMCIA Network Driver
|
||||
*
|
||||
* Original code
|
||||
* by Stephen Blackheath <stephen@blacksapphire.com>,
|
||||
* Ben Martel <benm@symmetric.co.nz>
|
||||
*
|
||||
* Copyrighted as follows:
|
||||
* Copyright (C) 2004 by Symmetric Systems Ltd (NZ)
|
||||
*
|
||||
* Various driver changes and rewrites, port to new kernels
|
||||
* Copyright (C) 2006-2007 Jiri Kosina
|
||||
*
|
||||
* Misc code cleanups and updates
|
||||
* Copyright (C) 2007 David Sterba
|
||||
*/
|
||||
|
||||
#ifndef _IPWIRELESS_CS_HARDWARE_H_
|
||||
#define _IPWIRELESS_CS_HARDWARE_H_
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/sched.h>
|
||||
#include <linux/interrupt.h>
|
||||
|
||||
#define IPW_CONTROL_LINE_CTS 0x0001
|
||||
#define IPW_CONTROL_LINE_DCD 0x0002
|
||||
#define IPW_CONTROL_LINE_DSR 0x0004
|
||||
#define IPW_CONTROL_LINE_RI 0x0008
|
||||
#define IPW_CONTROL_LINE_DTR 0x0010
|
||||
#define IPW_CONTROL_LINE_RTS 0x0020
|
||||
|
||||
struct ipw_hardware;
|
||||
struct ipw_network;
|
||||
|
||||
struct ipw_hardware *ipwireless_hardware_create(void);
|
||||
void ipwireless_hardware_free(struct ipw_hardware *hw);
|
||||
irqreturn_t ipwireless_interrupt(int irq, void *dev_id, struct pt_regs *regs);
|
||||
int ipwireless_set_DTR(struct ipw_hardware *hw, unsigned int channel_idx,
|
||||
int state);
|
||||
int ipwireless_set_RTS(struct ipw_hardware *hw, unsigned int channel_idx,
|
||||
int state);
|
||||
int ipwireless_send_packet(struct ipw_hardware *hw,
|
||||
unsigned int channel_idx,
|
||||
unsigned char *data,
|
||||
unsigned int length,
|
||||
void (*packet_sent_callback) (void *cb,
|
||||
unsigned int length),
|
||||
void *sent_cb_data);
|
||||
void ipwireless_associate_network(struct ipw_hardware *hw,
|
||||
struct ipw_network *net);
|
||||
void ipwireless_stop_interrupts(struct ipw_hardware *hw);
|
||||
void ipwireless_init_hardware_v1(struct ipw_hardware *hw,
|
||||
unsigned int base_port,
|
||||
void __iomem *attr_memory,
|
||||
void __iomem *common_memory,
|
||||
int is_v2_card,
|
||||
void (*reboot_cb) (void *data),
|
||||
void *reboot_cb_data);
|
||||
void ipwireless_init_hardware_v2_v3(struct ipw_hardware *hw);
|
||||
void ipwireless_sleep(unsigned int tenths);
|
||||
int ipwireless_dump_hardware_state(char *p, size_t limit,
|
||||
struct ipw_hardware *hw);
|
||||
|
||||
#endif
|
||||
501
drivers/char/pcmcia/ipwireless/main.c
Normal file
501
drivers/char/pcmcia/ipwireless/main.c
Normal file
File diff suppressed because it is too large
Load Diff
70
drivers/char/pcmcia/ipwireless/main.h
Normal file
70
drivers/char/pcmcia/ipwireless/main.h
Normal file
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
* IPWireless 3G PCMCIA Network Driver
|
||||
*
|
||||
* Original code
|
||||
* by Stephen Blackheath <stephen@blacksapphire.com>,
|
||||
* Ben Martel <benm@symmetric.co.nz>
|
||||
*
|
||||
* Copyrighted as follows:
|
||||
* Copyright (C) 2004 by Symmetric Systems Ltd (NZ)
|
||||
*
|
||||
* Various driver changes and rewrites, port to new kernels
|
||||
* Copyright (C) 2006-2007 Jiri Kosina
|
||||
*
|
||||
* Misc code cleanups and updates
|
||||
* Copyright (C) 2007 David Sterba
|
||||
*/
|
||||
|
||||
#ifndef _IPWIRELESS_CS_H_
|
||||
#define _IPWIRELESS_CS_H_
|
||||
|
||||
#include <linux/sched.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
#include <pcmcia/cs_types.h>
|
||||
#include <pcmcia/cs.h>
|
||||
#include <pcmcia/cistpl.h>
|
||||
#include <pcmcia/ds.h>
|
||||
|
||||
#include "hardware.h"
|
||||
|
||||
#define IPWIRELESS_PCCARD_NAME "ipwireless"
|
||||
#define IPWIRELESS_PCMCIA_VERSION "1.1"
|
||||
#define IPWIRELESS_PCMCIA_AUTHOR \
|
||||
"Stephen Blackheath, Ben Martel, Jiri Kosina and David Sterba"
|
||||
|
||||
#define IPWIRELESS_TX_QUEUE_SIZE 262144
|
||||
#define IPWIRELESS_RX_QUEUE_SIZE 262144
|
||||
|
||||
#define IPWIRELESS_STATE_DEBUG
|
||||
|
||||
struct ipw_hardware;
|
||||
struct ipw_network;
|
||||
struct ipw_tty;
|
||||
|
||||
struct ipw_dev {
|
||||
struct pcmcia_device *link;
|
||||
int is_v2_card;
|
||||
window_handle_t handle_attr_memory;
|
||||
void __iomem *attr_memory;
|
||||
window_handle_t handle_common_memory;
|
||||
void __iomem *common_memory;
|
||||
dev_node_t nodes[2];
|
||||
/* Reference to attribute memory, containing CIS data */
|
||||
void *attribute_memory;
|
||||
|
||||
/* Hardware context */
|
||||
struct ipw_hardware *hardware;
|
||||
/* Network layer context */
|
||||
struct ipw_network *network;
|
||||
/* TTY device context */
|
||||
struct ipw_tty *tty;
|
||||
struct work_struct work_reboot;
|
||||
};
|
||||
|
||||
/* Module parametres */
|
||||
extern int ipwireless_debug;
|
||||
extern int ipwireless_loopback;
|
||||
extern int ipwireless_out_queue;
|
||||
|
||||
#endif
|
||||
512
drivers/char/pcmcia/ipwireless/network.c
Normal file
512
drivers/char/pcmcia/ipwireless/network.c
Normal file
File diff suppressed because it is too large
Load Diff
55
drivers/char/pcmcia/ipwireless/network.h
Normal file
55
drivers/char/pcmcia/ipwireless/network.h
Normal file
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* IPWireless 3G PCMCIA Network Driver
|
||||
*
|
||||
* Original code
|
||||
* by Stephen Blackheath <stephen@blacksapphire.com>,
|
||||
* Ben Martel <benm@symmetric.co.nz>
|
||||
*
|
||||
* Copyrighted as follows:
|
||||
* Copyright (C) 2004 by Symmetric Systems Ltd (NZ)
|
||||
*
|
||||
* Various driver changes and rewrites, port to new kernels
|
||||
* Copyright (C) 2006-2007 Jiri Kosina
|
||||
*
|
||||
* Misc code cleanups and updates
|
||||
* Copyright (C) 2007 David Sterba
|
||||
*/
|
||||
|
||||
#ifndef _IPWIRELESS_CS_NETWORK_H_
|
||||
#define _IPWIRELESS_CS_NETWORK_H_
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
struct ipw_network;
|
||||
struct ipw_tty;
|
||||
struct ipw_hardware;
|
||||
|
||||
/* Definitions of the different channels on the PCMCIA UE */
|
||||
#define IPW_CHANNEL_RAS 0
|
||||
#define IPW_CHANNEL_DIALLER 1
|
||||
#define IPW_CHANNEL_CONSOLE 2
|
||||
#define NO_OF_IPW_CHANNELS 5
|
||||
|
||||
void ipwireless_network_notify_control_line_change(struct ipw_network *net,
|
||||
unsigned int channel_idx, unsigned int control_lines,
|
||||
unsigned int control_mask);
|
||||
void ipwireless_network_packet_received(struct ipw_network *net,
|
||||
unsigned int channel_idx, unsigned char *data,
|
||||
unsigned int length);
|
||||
struct ipw_network *ipwireless_network_create(struct ipw_hardware *hw);
|
||||
void ipwireless_network_free(struct ipw_network *net);
|
||||
void ipwireless_associate_network_tty(struct ipw_network *net,
|
||||
unsigned int channel_idx, struct ipw_tty *tty);
|
||||
void ipwireless_disassociate_network_ttys(struct ipw_network *net,
|
||||
unsigned int channel_idx);
|
||||
|
||||
void ipwireless_ppp_open(struct ipw_network *net);
|
||||
|
||||
void ipwireless_ppp_close(struct ipw_network *net);
|
||||
int ipwireless_ppp_channel_index(struct ipw_network *net);
|
||||
int ipwireless_ppp_unit_number(struct ipw_network *net);
|
||||
|
||||
int ipwireless_dump_network_state(char *p, size_t limit,
|
||||
struct ipw_network *net);
|
||||
|
||||
#endif
|
||||
108
drivers/char/pcmcia/ipwireless/setup_protocol.h
Normal file
108
drivers/char/pcmcia/ipwireless/setup_protocol.h
Normal file
@@ -0,0 +1,108 @@
|
||||
/*
|
||||
* IPWireless 3G PCMCIA Network Driver
|
||||
*
|
||||
* Original code
|
||||
* by Stephen Blackheath <stephen@blacksapphire.com>,
|
||||
* Ben Martel <benm@symmetric.co.nz>
|
||||
*
|
||||
* Copyrighted as follows:
|
||||
* Copyright (C) 2004 by Symmetric Systems Ltd (NZ)
|
||||
*
|
||||
* Various driver changes and rewrites, port to new kernels
|
||||
* Copyright (C) 2006-2007 Jiri Kosina
|
||||
*
|
||||
* Misc code cleanups and updates
|
||||
* Copyright (C) 2007 David Sterba
|
||||
*/
|
||||
|
||||
#ifndef _IPWIRELESS_CS_SETUP_PROTOCOL_H_
|
||||
#define _IPWIRELESS_CS_SETUP_PROTOCOL_H_
|
||||
|
||||
/* Version of the setup protocol and transport protocols */
|
||||
#define TL_SETUP_VERSION 1
|
||||
|
||||
#define TL_SETUP_VERSION_QRY_TMO 1000
|
||||
#define TL_SETUP_MAX_VERSION_QRY 30
|
||||
|
||||
/* Message numbers 0-9 are obsoleted and must not be reused! */
|
||||
#define TL_SETUP_SIGNO_GET_VERSION_QRY 10
|
||||
#define TL_SETUP_SIGNO_GET_VERSION_RSP 11
|
||||
#define TL_SETUP_SIGNO_CONFIG_MSG 12
|
||||
#define TL_SETUP_SIGNO_CONFIG_DONE_MSG 13
|
||||
#define TL_SETUP_SIGNO_OPEN_MSG 14
|
||||
#define TL_SETUP_SIGNO_CLOSE_MSG 15
|
||||
|
||||
#define TL_SETUP_SIGNO_INFO_MSG 20
|
||||
#define TL_SETUP_SIGNO_INFO_MSG_ACK 21
|
||||
|
||||
#define TL_SETUP_SIGNO_REBOOT_MSG 22
|
||||
#define TL_SETUP_SIGNO_REBOOT_MSG_ACK 23
|
||||
|
||||
/* Synchronous start-messages */
|
||||
struct tl_setup_get_version_qry {
|
||||
unsigned char sig_no; /* TL_SETUP_SIGNO_GET_VERSION_QRY */
|
||||
} __attribute__ ((__packed__));
|
||||
|
||||
struct tl_setup_get_version_rsp {
|
||||
unsigned char sig_no; /* TL_SETUP_SIGNO_GET_VERSION_RSP */
|
||||
unsigned char version; /* TL_SETUP_VERSION */
|
||||
} __attribute__ ((__packed__));
|
||||
|
||||
struct tl_setup_config_msg {
|
||||
unsigned char sig_no; /* TL_SETUP_SIGNO_CONFIG_MSG */
|
||||
unsigned char port_no;
|
||||
unsigned char prio_data;
|
||||
unsigned char prio_ctrl;
|
||||
} __attribute__ ((__packed__));
|
||||
|
||||
struct tl_setup_config_done_msg {
|
||||
unsigned char sig_no; /* TL_SETUP_SIGNO_CONFIG_DONE_MSG */
|
||||
} __attribute__ ((__packed__));
|
||||
|
||||
/* Asyncronous messages */
|
||||
struct tl_setup_open_msg {
|
||||
unsigned char sig_no; /* TL_SETUP_SIGNO_OPEN_MSG */
|
||||
unsigned char port_no;
|
||||
} __attribute__ ((__packed__));
|
||||
|
||||
struct tl_setup_close_msg {
|
||||
unsigned char sig_no; /* TL_SETUP_SIGNO_CLOSE_MSG */
|
||||
unsigned char port_no;
|
||||
} __attribute__ ((__packed__));
|
||||
|
||||
/* Driver type - for use in tl_setup_info_msg.driver_type */
|
||||
#define COMM_DRIVER 0
|
||||
#define NDISWAN_DRIVER 1
|
||||
#define NDISWAN_DRIVER_MAJOR_VERSION 2
|
||||
#define NDISWAN_DRIVER_MINOR_VERSION 0
|
||||
|
||||
/*
|
||||
* It should not matter when this message comes over as we just store the
|
||||
* results and send the ACK.
|
||||
*/
|
||||
struct tl_setup_info_msg {
|
||||
unsigned char sig_no; /* TL_SETUP_SIGNO_INFO_MSG */
|
||||
unsigned char driver_type;
|
||||
unsigned char major_version;
|
||||
unsigned char minor_version;
|
||||
} __attribute__ ((__packed__));
|
||||
|
||||
struct tl_setup_info_msgAck {
|
||||
unsigned char sig_no; /* TL_SETUP_SIGNO_INFO_MSG_ACK */
|
||||
} __attribute__ ((__packed__));
|
||||
|
||||
struct TlSetupRebootMsgAck {
|
||||
unsigned char sig_no; /* TL_SETUP_SIGNO_REBOOT_MSG_ACK */
|
||||
} __attribute__ ((__packed__));
|
||||
|
||||
/* Define a union of all the msgs that the driver can receive from the card.*/
|
||||
union ipw_setup_rx_msg {
|
||||
unsigned char sig_no;
|
||||
struct tl_setup_get_version_rsp version_rsp_msg;
|
||||
struct tl_setup_open_msg open_msg;
|
||||
struct tl_setup_close_msg close_msg;
|
||||
struct tl_setup_info_msg InfoMsg;
|
||||
struct tl_setup_info_msgAck info_msg_ack;
|
||||
} __attribute__ ((__packed__));
|
||||
|
||||
#endif /* _IPWIRELESS_CS_SETUP_PROTOCOL_H_ */
|
||||
688
drivers/char/pcmcia/ipwireless/tty.c
Normal file
688
drivers/char/pcmcia/ipwireless/tty.c
Normal file
File diff suppressed because it is too large
Load Diff
48
drivers/char/pcmcia/ipwireless/tty.h
Normal file
48
drivers/char/pcmcia/ipwireless/tty.h
Normal file
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* IPWireless 3G PCMCIA Network Driver
|
||||
*
|
||||
* Original code
|
||||
* by Stephen Blackheath <stephen@blacksapphire.com>,
|
||||
* Ben Martel <benm@symmetric.co.nz>
|
||||
*
|
||||
* Copyrighted as follows:
|
||||
* Copyright (C) 2004 by Symmetric Systems Ltd (NZ)
|
||||
*
|
||||
* Various driver changes and rewrites, port to new kernels
|
||||
* Copyright (C) 2006-2007 Jiri Kosina
|
||||
*
|
||||
* Misc code cleanups and updates
|
||||
* Copyright (C) 2007 David Sterba
|
||||
*/
|
||||
|
||||
#ifndef _IPWIRELESS_CS_TTY_H_
|
||||
#define _IPWIRELESS_CS_TTY_H_
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/sched.h>
|
||||
|
||||
#include <pcmcia/cs_types.h>
|
||||
#include <pcmcia/cs.h>
|
||||
#include <pcmcia/cistpl.h>
|
||||
#include <pcmcia/ds.h>
|
||||
|
||||
struct ipw_tty;
|
||||
struct ipw_network;
|
||||
struct ipw_hardware;
|
||||
|
||||
int ipwireless_tty_init(void);
|
||||
void ipwireless_tty_release(void);
|
||||
|
||||
struct ipw_tty *ipwireless_tty_create(struct ipw_hardware *hw,
|
||||
struct ipw_network *net,
|
||||
dev_node_t *nodes);
|
||||
void ipwireless_tty_free(struct ipw_tty *tty);
|
||||
void ipwireless_tty_received(struct ipw_tty *tty, unsigned char *data,
|
||||
unsigned int length);
|
||||
int ipwireless_tty_is_modem(struct ipw_tty *tty);
|
||||
void ipwireless_tty_notify_control_line_change(struct ipw_tty *tty,
|
||||
unsigned int channel_idx,
|
||||
unsigned int control_lines,
|
||||
unsigned int changed_mask);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user