Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
hso.c File Reference
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/netdevice.h>
#include <linux/module.h>
#include <linux/ethtool.h>
#include <linux/usb.h>
#include <linux/timer.h>
#include <linux/tty.h>
#include <linux/tty_driver.h>
#include <linux/tty_flip.h>
#include <linux/kmod.h>
#include <linux/rfkill.h>
#include <linux/ip.h>
#include <linux/uaccess.h>
#include <linux/usb/cdc.h>
#include <net/arp.h>
#include <asm/byteorder.h>
#include <linux/serial_core.h>
#include <linux/serial.h>

Go to the source code of this file.

Data Structures

struct  hso_shared_int
 
struct  hso_net
 
struct  hso_serial_state_notification
 
struct  hso_tiocmget
 
struct  hso_serial
 
struct  hso_device
 

Macros

#define MOD_AUTHOR   "Option Wireless"
 
#define MOD_DESCRIPTION   "USB High Speed Option driver"
 
#define MOD_LICENSE   "GPL"
 
#define HSO_MAX_NET_DEVICES   10
 
#define HSO__MAX_MTU   2048
 
#define DEFAULT_MTU   1500
 
#define DEFAULT_MRU   1500
 
#define CTRL_URB_RX_SIZE   1024
 
#define CTRL_URB_TX_SIZE   64
 
#define BULK_URB_RX_SIZE   4096
 
#define BULK_URB_TX_SIZE   8192
 
#define MUX_BULK_RX_BUF_SIZE   HSO__MAX_MTU
 
#define MUX_BULK_TX_BUF_SIZE   HSO__MAX_MTU
 
#define MUX_BULK_RX_BUF_COUNT   4
 
#define USB_TYPE_OPTION_VENDOR   0x20
 
#define HSO_NET_RUNNING   0
 
#define HSO_NET_TX_TIMEOUT   (HZ*10)
 
#define HSO_SERIAL_MAGIC   0x48534f31
 
#define HSO_SERIAL_TTY_MINORS   256
 
#define MAX_RX_URBS   2
 
#define D__(lvl_, fmt, arg...)
 
#define D_(lvl, args...)
 
#define D1(args...)   D_(0x01, ##args)
 
#define D2(args...)   D_(0x02, ##args)
 
#define D3(args...)   D_(0x04, ##args)
 
#define D4(args...)   D_(0x08, ##args)
 
#define D5(args...)   D_(0x10, ##args)
 
#define BM_REQUEST_TYPE   (0xa1)
 
#define B_NOTIFICATION   (0x20)
 
#define W_VALUE   (0x0)
 
#define W_INDEX   (0x2)
 
#define W_LENGTH   (0x2)
 
#define B_OVERRUN   (0x1<<6)
 
#define B_PARITY   (0x1<<5)
 
#define B_FRAMING   (0x1<<4)
 
#define B_RING_SIGNAL   (0x1<<3)
 
#define B_BREAK   (0x1<<2)
 
#define B_TX_CARRIER   (0x1<<1)
 
#define B_RX_CARRIER   (0x1<<0)
 
#define HSO_INTF_MASK   0xFF00
 
#define HSO_INTF_MUX   0x0100
 
#define HSO_INTF_BULK   0x0200
 
#define HSO_PORT_MASK   0xFF
 
#define HSO_PORT_NO_PORT   0x0
 
#define HSO_PORT_CONTROL   0x1
 
#define HSO_PORT_APP   0x2
 
#define HSO_PORT_GPS   0x3
 
#define HSO_PORT_PCSC   0x4
 
#define HSO_PORT_APP2   0x5
 
#define HSO_PORT_GPS_CONTROL   0x6
 
#define HSO_PORT_MSD   0x7
 
#define HSO_PORT_VOICE   0x8
 
#define HSO_PORT_DIAG2   0x9
 
#define HSO_PORT_DIAG   0x10
 
#define HSO_PORT_MODEM   0x11
 
#define HSO_PORT_NETWORK   0x12
 
#define HSO_INFO_MASK   0xFF000000
 
#define HSO_INFO_CRC_BUG   0x01000000
 
#define DUMP(buf_, len_)
 
#define DUMP1(buf_, len_)
 
#define default_port_device(vendor, product)
 
#define icon321_port_device(vendor, product)
 

Enumerations

enum  pkt_parse_state { WAIT_IP, WAIT_DATA, WAIT_SYNC }
 
enum  rx_ctrl_state { RX_IDLE, RX_SENT, RX_PENDING }
 

Functions

 MODULE_DEVICE_TABLE (usb, hso_ids)
 
 module_init (hso_init)
 
 module_exit (hso_exit)
 
 MODULE_AUTHOR (MOD_AUTHOR)
 
 MODULE_DESCRIPTION (MOD_DESCRIPTION)
 
 MODULE_LICENSE (MOD_LICENSE)
 
 MODULE_PARM_DESC (debug,"Level of debug [0x01 | 0x02 | 0x04 | 0x08 | 0x10]")
 
 module_param (debug, int, S_IRUGO|S_IWUSR)
 
 MODULE_PARM_DESC (tty_major,"Set the major tty number")
 
 module_param (tty_major, int, S_IRUGO|S_IWUSR)
 
 MODULE_PARM_DESC (disable_net,"Disable the network interface")
 
 module_param (disable_net, int, S_IRUGO|S_IWUSR)
 

Variables

struct
hso_serial_state_notification 
__packed
 

Macro Definition Documentation

#define B_BREAK   (0x1<<2)

Definition at line 195 of file hso.c.

#define B_FRAMING   (0x1<<4)

Definition at line 193 of file hso.c.

#define B_NOTIFICATION   (0x20)

Definition at line 186 of file hso.c.

#define B_OVERRUN   (0x1<<6)

Definition at line 191 of file hso.c.

#define B_PARITY   (0x1<<5)

Definition at line 192 of file hso.c.

#define B_RING_SIGNAL   (0x1<<3)

Definition at line 194 of file hso.c.

#define B_RX_CARRIER   (0x1<<0)

Definition at line 197 of file hso.c.

#define B_TX_CARRIER   (0x1<<1)

Definition at line 196 of file hso.c.

#define BM_REQUEST_TYPE   (0xa1)

Definition at line 185 of file hso.c.

#define BULK_URB_RX_SIZE   4096

Definition at line 88 of file hso.c.

#define BULK_URB_TX_SIZE   8192

Definition at line 89 of file hso.c.

#define CTRL_URB_RX_SIZE   1024

Definition at line 85 of file hso.c.

#define CTRL_URB_TX_SIZE   64

Definition at line 86 of file hso.c.

#define D1 (   args...)    D_(0x01, ##args)

Definition at line 124 of file hso.c.

#define D2 (   args...)    D_(0x02, ##args)

Definition at line 125 of file hso.c.

#define D3 (   args...)    D_(0x04, ##args)

Definition at line 126 of file hso.c.

#define D4 (   args...)    D_(0x08, ##args)

Definition at line 127 of file hso.c.

#define D5 (   args...)    D_(0x10, ##args)

Definition at line 128 of file hso.c.

#define D_ (   lvl,
  args... 
)
Value:
do { \
if (lvl & debug) \
D__(KERN_INFO, args); \
} while (0)

Definition at line 118 of file hso.c.

#define D__ (   lvl_,
  fmt,
  arg... 
)
Value:
do { \
printk(lvl_ "[%d:%s]: " fmt "\n", \
__LINE__, __func__, ## arg); \
} while (0)

Definition at line 112 of file hso.c.

#define DEFAULT_MRU   1500

Definition at line 83 of file hso.c.

#define DEFAULT_MTU   1500

Definition at line 82 of file hso.c.

#define default_port_device (   vendor,
  product 
)
Value:
USB_DEVICE(vendor, product), \
.driver_info = (kernel_ulong_t)default_port_spec

Definition at line 419 of file hso.c.

#define DUMP (   buf_,
  len_ 
)

Definition at line 383 of file hso.c.

#define DUMP1 (   buf_,
  len_ 
)

Definition at line 384 of file hso.c.

#define HSO__MAX_MTU   2048

Definition at line 81 of file hso.c.

#define HSO_INFO_CRC_BUG   0x01000000

Definition at line 313 of file hso.c.

#define HSO_INFO_MASK   0xFF000000

Definition at line 312 of file hso.c.

#define HSO_INTF_BULK   0x0200

Definition at line 293 of file hso.c.

#define HSO_INTF_MASK   0xFF00

Definition at line 291 of file hso.c.

#define HSO_INTF_MUX   0x0100

Definition at line 292 of file hso.c.

#define HSO_MAX_NET_DEVICES   10

Definition at line 80 of file hso.c.

#define HSO_NET_RUNNING   0

Definition at line 98 of file hso.c.

#define HSO_NET_TX_TIMEOUT   (HZ*10)

Definition at line 100 of file hso.c.

#define HSO_PORT_APP   0x2

Definition at line 299 of file hso.c.

#define HSO_PORT_APP2   0x5

Definition at line 302 of file hso.c.

#define HSO_PORT_CONTROL   0x1

Definition at line 298 of file hso.c.

#define HSO_PORT_DIAG   0x10

Definition at line 307 of file hso.c.

#define HSO_PORT_DIAG2   0x9

Definition at line 306 of file hso.c.

#define HSO_PORT_GPS   0x3

Definition at line 300 of file hso.c.

#define HSO_PORT_GPS_CONTROL   0x6

Definition at line 303 of file hso.c.

#define HSO_PORT_MASK   0xFF

Definition at line 296 of file hso.c.

#define HSO_PORT_MODEM   0x11

Definition at line 308 of file hso.c.

#define HSO_PORT_MSD   0x7

Definition at line 304 of file hso.c.

#define HSO_PORT_NETWORK   0x12

Definition at line 309 of file hso.c.

#define HSO_PORT_NO_PORT   0x0

Definition at line 297 of file hso.c.

#define HSO_PORT_PCSC   0x4

Definition at line 301 of file hso.c.

#define HSO_PORT_VOICE   0x8

Definition at line 305 of file hso.c.

#define HSO_SERIAL_MAGIC   0x48534f31

Definition at line 102 of file hso.c.

#define HSO_SERIAL_TTY_MINORS   256

Definition at line 105 of file hso.c.

#define icon321_port_device (   vendor,
  product 
)
Value:
USB_DEVICE(vendor, product), \
.driver_info = (kernel_ulong_t)icon321_port_spec

Definition at line 423 of file hso.c.

#define MAX_RX_URBS   2

Definition at line 107 of file hso.c.

#define MOD_AUTHOR   "Option Wireless"

Definition at line 76 of file hso.c.

#define MOD_DESCRIPTION   "USB High Speed Option driver"

Definition at line 77 of file hso.c.

#define MOD_LICENSE   "GPL"

Definition at line 78 of file hso.c.

#define MUX_BULK_RX_BUF_COUNT   4

Definition at line 93 of file hso.c.

#define MUX_BULK_RX_BUF_SIZE   HSO__MAX_MTU

Definition at line 91 of file hso.c.

#define MUX_BULK_TX_BUF_SIZE   HSO__MAX_MTU

Definition at line 92 of file hso.c.

#define USB_TYPE_OPTION_VENDOR   0x20

Definition at line 94 of file hso.c.

#define W_INDEX   (0x2)

Definition at line 188 of file hso.c.

#define W_LENGTH   (0x2)

Definition at line 189 of file hso.c.

#define W_VALUE   (0x0)

Definition at line 187 of file hso.c.

Enumeration Type Documentation

Enumerator:
WAIT_IP 
WAIT_DATA 
WAIT_SYNC 

Definition at line 133 of file hso.c.

Enumerator:
RX_IDLE 
RX_SENT 
RX_PENDING 

Definition at line 179 of file hso.c.

Function Documentation

MODULE_AUTHOR ( MOD_AUTHOR  )
MODULE_DESCRIPTION ( MOD_DESCRIPTION  )
MODULE_DEVICE_TABLE ( usb  ,
hso_ids   
)
module_exit ( hso_exit  )
module_init ( hso_init  )
MODULE_LICENSE ( MOD_LICENSE  )
module_param ( debug  ,
int  ,
S_IRUGO S_IWUSR 
)
module_param ( tty_major  ,
int  ,
S_IRUGO S_IWUSR 
)
module_param ( disable_net  ,
int  ,
S_IRUGO S_IWUSR 
)
MODULE_PARM_DESC ( debug  ,
"Level of debug [0x01|0x02|0x04|0x08|0x10] 
)
MODULE_PARM_DESC ( tty_major  ,
"Set the major tty number  
)
MODULE_PARM_DESC ( disable_net  ,
"Disable the network interface  
)

Variable Documentation