Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
garmin_gps.c File Reference
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/timer.h>
#include <linux/tty.h>
#include <linux/tty_driver.h>
#include <linux/tty_flip.h>
#include <linux/module.h>
#include <linux/spinlock.h>
#include <linux/uaccess.h>
#include <linux/atomic.h>
#include <linux/usb.h>
#include <linux/usb/serial.h>

Go to the source code of this file.

Data Structures

struct  garmin_packet
 
struct  garmin_data
 

Macros

#define GARMIN_VENDOR_ID   0x091E
 
#define VERSION_MAJOR   0
 
#define VERSION_MINOR   36
 
#define _STR(s)   #s
 
#define _DRIVER_VERSION(a, b)   "v" _STR(a) "." _STR(b)
 
#define DRIVER_VERSION   _DRIVER_VERSION(VERSION_MAJOR, VERSION_MINOR)
 
#define DRIVER_AUTHOR   "hermann kneissel"
 
#define DRIVER_DESC   "garmin gps driver"
 
#define EINVPKT   1000 /* invalid packet structure */
 
#define GARMIN_PKTHDR_LENGTH   12
 
#define MAX_SERIAL_PKT_SIZ   (3 + 255 + 3)
 
#define MAX_SERIAL_PKT_SIZ_STUFFED   (MAX_SERIAL_PKT_SIZ + 256)
 
#define GPS_IN_BUFSIZ   (GARMIN_PKTHDR_LENGTH+MAX_SERIAL_PKT_SIZ)
 
#define GPS_OUT_BUFSIZ   (GARMIN_PKTHDR_LENGTH+MAX_SERIAL_PKT_SIZ_STUFFED)
 
#define GSP_INITIAL_OFFSET   (GARMIN_PKTHDR_LENGTH-2)
 
#define PRIVPKTSIZ   (GARMIN_PKTHDR_LENGTH+4)
 
#define GARMIN_LAYERID_TRANSPORT   0
 
#define GARMIN_LAYERID_APPL   20
 
#define GARMIN_LAYERID_PRIVATE   0x01106E4B
 
#define GARMIN_PKTID_PVT_DATA   51
 
#define GARMIN_PKTID_L001_COMMAND_DATA   10
 
#define CMND_ABORT_TRANSFER   0
 
#define PRIV_PKTID_SET_DEBUG   1
 
#define PRIV_PKTID_SET_MODE   2
 
#define PRIV_PKTID_INFO_REQ   3
 
#define PRIV_PKTID_INFO_RESP   4
 
#define PRIV_PKTID_RESET_REQ   5
 
#define PRIV_PKTID_SET_DEF_MODE   6
 
#define ETX   0x03
 
#define DLE   0x10
 
#define ACK   0x06
 
#define NAK   0x15
 
#define STATE_NEW   0
 
#define STATE_INITIAL_DELAY   1
 
#define STATE_TIMEOUT   2
 
#define STATE_SESSION_REQ1   3
 
#define STATE_SESSION_REQ2   4
 
#define STATE_ACTIVE   5
 
#define STATE_RESET   8
 
#define STATE_DISCONNECTED   9
 
#define STATE_WAIT_TTY_ACK   10
 
#define STATE_GSP_WAIT_DATA   11
 
#define MODE_NATIVE   0
 
#define MODE_GARMIN_SERIAL   1
 
#define FLAGS_SESSION_REPLY_MASK   0x00C0
 
#define FLAGS_SESSION_REPLY1_SEEN   0x0080
 
#define FLAGS_SESSION_REPLY2_SEEN   0x0040
 
#define FLAGS_BULK_IN_ACTIVE   0x0020
 
#define FLAGS_BULK_IN_RESTART   0x0010
 
#define FLAGS_THROTTLED   0x0008
 
#define APP_REQ_SEEN   0x0004
 
#define APP_RESP_SEEN   0x0002
 
#define CLEAR_HALT_REQUIRED   0x0001
 
#define FLAGS_QUEUING   0x0100
 
#define FLAGS_DROP_DATA   0x0800
 
#define FLAGS_GSP_SKIP   0x1000
 
#define FLAGS_GSP_DLESEEN   0x2000
 

Functions

 MODULE_DEVICE_TABLE (usb, id_table)
 
 module_usb_serial_driver (serial_drivers, id_table)
 
 MODULE_AUTHOR (DRIVER_AUTHOR)
 
 MODULE_DESCRIPTION (DRIVER_DESC)
 
 MODULE_LICENSE ("GPL")
 
 module_param (initial_mode, int, S_IRUGO)
 
 MODULE_PARM_DESC (initial_mode,"Initial mode")
 

Macro Definition Documentation

#define _DRIVER_VERSION (   a,
  b 
)    "v" _STR(a) "." _STR(b)

Definition at line 54 of file garmin_gps.c.

#define _STR (   s)    #s

Definition at line 53 of file garmin_gps.c.

#define ACK   0x06

Definition at line 112 of file garmin_gps.c.

#define APP_REQ_SEEN   0x0004

Definition at line 167 of file garmin_gps.c.

#define APP_RESP_SEEN   0x0002

Definition at line 168 of file garmin_gps.c.

#define CLEAR_HALT_REQUIRED   0x0001

Definition at line 169 of file garmin_gps.c.

#define CMND_ABORT_TRANSFER   0

Definition at line 99 of file garmin_gps.c.

#define DLE   0x10

Definition at line 111 of file garmin_gps.c.

#define DRIVER_AUTHOR   "hermann kneissel"

Definition at line 56 of file garmin_gps.c.

#define DRIVER_DESC   "garmin gps driver"

Definition at line 57 of file garmin_gps.c.

#define DRIVER_VERSION   _DRIVER_VERSION(VERSION_MAJOR, VERSION_MINOR)

Definition at line 55 of file garmin_gps.c.

#define EINVPKT   1000 /* invalid packet structure */

Definition at line 60 of file garmin_gps.c.

#define ETX   0x03

Definition at line 110 of file garmin_gps.c.

#define FLAGS_BULK_IN_ACTIVE   0x0020

Definition at line 164 of file garmin_gps.c.

#define FLAGS_BULK_IN_RESTART   0x0010

Definition at line 165 of file garmin_gps.c.

#define FLAGS_DROP_DATA   0x0800

Definition at line 172 of file garmin_gps.c.

#define FLAGS_GSP_DLESEEN   0x2000

Definition at line 175 of file garmin_gps.c.

#define FLAGS_GSP_SKIP   0x1000

Definition at line 174 of file garmin_gps.c.

#define FLAGS_QUEUING   0x0100

Definition at line 171 of file garmin_gps.c.

#define FLAGS_SESSION_REPLY1_SEEN   0x0080

Definition at line 162 of file garmin_gps.c.

#define FLAGS_SESSION_REPLY2_SEEN   0x0040

Definition at line 163 of file garmin_gps.c.

#define FLAGS_SESSION_REPLY_MASK   0x00C0

Definition at line 161 of file garmin_gps.c.

#define FLAGS_THROTTLED   0x0008

Definition at line 166 of file garmin_gps.c.

#define GARMIN_LAYERID_APPL   20

Definition at line 92 of file garmin_gps.c.

#define GARMIN_LAYERID_PRIVATE   0x01106E4B

Definition at line 94 of file garmin_gps.c.

#define GARMIN_LAYERID_TRANSPORT   0

Definition at line 91 of file garmin_gps.c.

#define GARMIN_PKTHDR_LENGTH   12

Definition at line 64 of file garmin_gps.c.

#define GARMIN_PKTID_L001_COMMAND_DATA   10

Definition at line 97 of file garmin_gps.c.

#define GARMIN_PKTID_PVT_DATA   51

Definition at line 96 of file garmin_gps.c.

#define GARMIN_VENDOR_ID   0x091E

Definition at line 44 of file garmin_gps.c.

#define GPS_IN_BUFSIZ   (GARMIN_PKTHDR_LENGTH+MAX_SERIAL_PKT_SIZ)

Definition at line 78 of file garmin_gps.c.

#define GPS_OUT_BUFSIZ   (GARMIN_PKTHDR_LENGTH+MAX_SERIAL_PKT_SIZ_STUFFED)

Definition at line 81 of file garmin_gps.c.

#define GSP_INITIAL_OFFSET   (GARMIN_PKTHDR_LENGTH-2)

Definition at line 86 of file garmin_gps.c.

#define MAX_SERIAL_PKT_SIZ   (3 + 255 + 3)

Definition at line 67 of file garmin_gps.c.

#define MAX_SERIAL_PKT_SIZ_STUFFED   (MAX_SERIAL_PKT_SIZ + 256)

Definition at line 70 of file garmin_gps.c.

#define MODE_GARMIN_SERIAL   1

Definition at line 158 of file garmin_gps.c.

#define MODE_NATIVE   0

Definition at line 157 of file garmin_gps.c.

#define NAK   0x15

Definition at line 113 of file garmin_gps.c.

#define PRIV_PKTID_INFO_REQ   3

Definition at line 104 of file garmin_gps.c.

#define PRIV_PKTID_INFO_RESP   4

Definition at line 105 of file garmin_gps.c.

#define PRIV_PKTID_RESET_REQ   5

Definition at line 106 of file garmin_gps.c.

#define PRIV_PKTID_SET_DEBUG   1

Definition at line 102 of file garmin_gps.c.

#define PRIV_PKTID_SET_DEF_MODE   6

Definition at line 107 of file garmin_gps.c.

#define PRIV_PKTID_SET_MODE   2

Definition at line 103 of file garmin_gps.c.

#define PRIVPKTSIZ   (GARMIN_PKTHDR_LENGTH+4)

Definition at line 89 of file garmin_gps.c.

#define STATE_ACTIVE   5

Definition at line 150 of file garmin_gps.c.

#define STATE_DISCONNECTED   9

Definition at line 153 of file garmin_gps.c.

#define STATE_GSP_WAIT_DATA   11

Definition at line 155 of file garmin_gps.c.

#define STATE_INITIAL_DELAY   1

Definition at line 146 of file garmin_gps.c.

#define STATE_NEW   0

Definition at line 145 of file garmin_gps.c.

#define STATE_RESET   8

Definition at line 152 of file garmin_gps.c.

#define STATE_SESSION_REQ1   3

Definition at line 148 of file garmin_gps.c.

#define STATE_SESSION_REQ2   4

Definition at line 149 of file garmin_gps.c.

#define STATE_TIMEOUT   2

Definition at line 147 of file garmin_gps.c.

#define STATE_WAIT_TTY_ACK   10

Definition at line 154 of file garmin_gps.c.

#define VERSION_MAJOR   0

Definition at line 50 of file garmin_gps.c.

#define VERSION_MINOR   36

Definition at line 51 of file garmin_gps.c.

Function Documentation

MODULE_AUTHOR ( DRIVER_AUTHOR  )
MODULE_DESCRIPTION ( DRIVER_DESC  )
MODULE_DEVICE_TABLE ( usb  ,
id_table   
)
MODULE_LICENSE ( "GPL"  )
module_param ( initial_mode  ,
int  ,
S_IRUGO   
)
MODULE_PARM_DESC ( initial_mode  ,
"Initial mode  
)
module_usb_serial_driver ( serial_drivers  ,
id_table   
)