Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
yam.c File Reference
#include <linux/module.h>
#include <linux/types.h>
#include <linux/net.h>
#include <linux/in.h>
#include <linux/if.h>
#include <linux/slab.h>
#include <linux/errno.h>
#include <linux/bitops.h>
#include <linux/random.h>
#include <asm/io.h>
#include <linux/interrupt.h>
#include <linux/ioport.h>
#include <linux/firmware.h>
#include <linux/platform_device.h>
#include <linux/netdevice.h>
#include <linux/if_arp.h>
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
#include <net/ax25.h>
#include <linux/kernel.h>
#include <linux/proc_fs.h>
#include <linux/seq_file.h>
#include <net/net_namespace.h>
#include <asm/uaccess.h>
#include <linux/init.h>
#include <linux/yam.h>

Go to the source code of this file.

Data Structures

struct  yam_port
 
struct  yam_mcs
 

Macros

#define FIRMWARE_9600   "yam/9600.bin"
 
#define FIRMWARE_1200   "yam/1200.bin"
 
#define YAM_9600   1
 
#define YAM_1200   2
 
#define NR_PORTS   4
 
#define YAM_MAGIC   0xF10A7654
 
#define TX_OFF   0
 
#define TX_HEAD   1
 
#define TX_DATA   2
 
#define TX_CRC1   3
 
#define TX_CRC2   4
 
#define TX_TAIL   5
 
#define YAM_MAX_FRAME   1024
 
#define DEFAULT_BITRATE   9600 /* bps */
 
#define DEFAULT_HOLDD   10 /* sec */
 
#define DEFAULT_TXD   300 /* ms */
 
#define DEFAULT_TXTAIL   10 /* ms */
 
#define DEFAULT_SLOT   100 /* ms */
 
#define DEFAULT_PERS   64 /* 0->255 */
 
#define RBR(iobase)   (iobase+0)
 
#define THR(iobase)   (iobase+0)
 
#define IER(iobase)   (iobase+1)
 
#define IIR(iobase)   (iobase+2)
 
#define FCR(iobase)   (iobase+2)
 
#define LCR(iobase)   (iobase+3)
 
#define MCR(iobase)   (iobase+4)
 
#define LSR(iobase)   (iobase+5)
 
#define MSR(iobase)   (iobase+6)
 
#define SCR(iobase)   (iobase+7)
 
#define DLL(iobase)   (iobase+0)
 
#define DLM(iobase)   (iobase+1)
 
#define YAM_EXTENT   8
 
#define IIR_NOPEND   1
 
#define IIR_MSR   0
 
#define IIR_TX   2
 
#define IIR_RX   4
 
#define IIR_LSR   6
 
#define IIR_TIMEOUT   12 /* Fifo mode only */
 
#define IIR_MASK   0x0F
 
#define IER_RX   1 /* enable rx interrupt */
 
#define IER_TX   2 /* enable tx interrupt */
 
#define IER_LSR   4 /* enable line status interrupts */
 
#define IER_MSR   8 /* enable modem status interrupts */
 
#define MCR_DTR   0x01 /* DTR output */
 
#define MCR_RTS   0x02 /* RTS output */
 
#define MCR_OUT1   0x04 /* OUT1 output (not accessible in RS232) */
 
#define MCR_OUT2   0x08 /* Master Interrupt enable (must be set on PCs) */
 
#define MCR_LOOP   0x10 /* Loopback enable */
 
#define MSR_DCTS   0x01 /* Delta CTS input */
 
#define MSR_DDSR   0x02 /* Delta DSR */
 
#define MSR_DRIN   0x04 /* Delta RI */
 
#define MSR_DDCD   0x08 /* Delta DCD */
 
#define MSR_CTS   0x10 /* CTS input */
 
#define MSR_DSR   0x20 /* DSR input */
 
#define MSR_RING   0x40 /* RI input */
 
#define MSR_DCD   0x80 /* DCD input */
 
#define LSR_RXC   0x01
 
#define LSR_OE   0x02
 
#define LSR_PE   0x04
 
#define LSR_FE   0x08
 
#define LSR_BREAK   0x10
 
#define LSR_THRE   0x20
 
#define LSR_TSRE   0x40
 
#define LCR_DLAB   0x80
 
#define LCR_BREAK   0x40
 
#define LCR_PZERO   0x28
 
#define LCR_PEVEN   0x18
 
#define LCR_PODD   0x08
 
#define LCR_STOP1   0x00
 
#define LCR_STOP2   0x04
 
#define LCR_BIT5   0x00
 
#define LCR_BIT6   0x02
 
#define LCR_BIT7   0x01
 
#define LCR_BIT8   0x03
 
#define TX_RDY   MSR_DCTS /* transmitter ready to send */
 
#define RX_DCD   MSR_DCD /* carrier detect */
 
#define RX_FLAG   MSR_RING /* hdlc flag received */
 
#define FPGA_DONE   MSR_DSR /* FPGA is configured */
 
#define PTT_ON   (MCR_RTS|MCR_OUT2) /* activate PTT */
 
#define PTT_OFF   (MCR_DTR|MCR_OUT2) /* release PTT */
 
#define ENABLE_RXINT   IER_RX /* enable uart rx interrupt during rx */
 
#define ENABLE_TXINT   IER_MSR /* enable uart ms interrupt during tx */
 
#define ENABLE_RTXINT   (IER_RX|IER_MSR) /* full duplex operations */
 

Enumerations

enum  uart {
  c_uart_unknown, c_uart_8250, c_uart_16450, c_uart_16550,
  c_uart_16550A, c_uart_unknown, c_uart_8250, c_uart_16450,
  c_uart_16550, c_uart_16550A, c_uart_unknown, c_uart_8250,
  c_uart_16450, c_uart_16550, c_uart_16550A
}
 

Functions

 MODULE_AUTHOR ("Frederic Rible F1OAT [email protected]")
 
 MODULE_DESCRIPTION ("Yam amateur radio modem driver")
 
 MODULE_LICENSE ("GPL")
 
 MODULE_FIRMWARE (FIRMWARE_1200)
 
 MODULE_FIRMWARE (FIRMWARE_9600)
 
 module_init (yam_init_driver)
 
 module_exit (yam_cleanup_driver)
 

Macro Definition Documentation

#define DEFAULT_BITRATE   9600 /* bps */

Definition at line 104 of file yam.c.

#define DEFAULT_HOLDD   10 /* sec */

Definition at line 105 of file yam.c.

#define DEFAULT_PERS   64 /* 0->255 */

Definition at line 109 of file yam.c.

#define DEFAULT_SLOT   100 /* ms */

Definition at line 108 of file yam.c.

#define DEFAULT_TXD   300 /* ms */

Definition at line 106 of file yam.c.

#define DEFAULT_TXTAIL   10 /* ms */

Definition at line 107 of file yam.c.

#define DLL (   iobase)    (iobase+0)

Definition at line 174 of file yam.c.

#define DLM (   iobase)    (iobase+1)

Definition at line 175 of file yam.c.

#define ENABLE_RTXINT   (IER_RX|IER_MSR) /* full duplex operations */

Definition at line 245 of file yam.c.

#define ENABLE_RXINT   IER_RX /* enable uart rx interrupt during rx */

Definition at line 243 of file yam.c.

#define ENABLE_TXINT   IER_MSR /* enable uart ms interrupt during tx */

Definition at line 244 of file yam.c.

#define FCR (   iobase)    (iobase+2)

Definition at line 168 of file yam.c.

#define FIRMWARE_1200   "yam/1200.bin"

Definition at line 85 of file yam.c.

#define FIRMWARE_9600   "yam/9600.bin"

Definition at line 84 of file yam.c.

#define FPGA_DONE   MSR_DSR /* FPGA is configured */

Definition at line 239 of file yam.c.

#define IER (   iobase)    (iobase+1)

Definition at line 166 of file yam.c.

#define IER_LSR   4 /* enable line status interrupts */

Definition at line 192 of file yam.c.

#define IER_MSR   8 /* enable modem status interrupts */

Definition at line 193 of file yam.c.

#define IER_RX   1 /* enable rx interrupt */

Definition at line 190 of file yam.c.

#define IER_TX   2 /* enable tx interrupt */

Definition at line 191 of file yam.c.

#define IIR (   iobase)    (iobase+2)

Definition at line 167 of file yam.c.

#define IIR_LSR   6

Definition at line 184 of file yam.c.

#define IIR_MASK   0x0F

Definition at line 187 of file yam.c.

#define IIR_MSR   0

Definition at line 181 of file yam.c.

#define IIR_NOPEND   1

Definition at line 180 of file yam.c.

#define IIR_RX   4

Definition at line 183 of file yam.c.

#define IIR_TIMEOUT   12 /* Fifo mode only */

Definition at line 185 of file yam.c.

#define IIR_TX   2

Definition at line 182 of file yam.c.

#define LCR (   iobase)    (iobase+3)

Definition at line 169 of file yam.c.

#define LCR_BIT5   0x00

Definition at line 229 of file yam.c.

#define LCR_BIT6   0x02

Definition at line 230 of file yam.c.

#define LCR_BIT7   0x01

Definition at line 231 of file yam.c.

#define LCR_BIT8   0x03

Definition at line 232 of file yam.c.

#define LCR_BREAK   0x40

Definition at line 223 of file yam.c.

#define LCR_DLAB   0x80

Definition at line 222 of file yam.c.

#define LCR_PEVEN   0x18

Definition at line 225 of file yam.c.

#define LCR_PODD   0x08

Definition at line 226 of file yam.c.

#define LCR_PZERO   0x28

Definition at line 224 of file yam.c.

#define LCR_STOP1   0x00

Definition at line 227 of file yam.c.

#define LCR_STOP2   0x04

Definition at line 228 of file yam.c.

#define LSR (   iobase)    (iobase+5)

Definition at line 171 of file yam.c.

#define LSR_BREAK   0x10

Definition at line 217 of file yam.c.

#define LSR_FE   0x08

Definition at line 216 of file yam.c.

#define LSR_OE   0x02

Definition at line 214 of file yam.c.

#define LSR_PE   0x04

Definition at line 215 of file yam.c.

#define LSR_RXC   0x01

Definition at line 213 of file yam.c.

#define LSR_THRE   0x20

Definition at line 218 of file yam.c.

#define LSR_TSRE   0x40

Definition at line 219 of file yam.c.

#define MCR (   iobase)    (iobase+4)

Definition at line 170 of file yam.c.

#define MCR_DTR   0x01 /* DTR output */

Definition at line 196 of file yam.c.

#define MCR_LOOP   0x10 /* Loopback enable */

Definition at line 200 of file yam.c.

#define MCR_OUT1   0x04 /* OUT1 output (not accessible in RS232) */

Definition at line 198 of file yam.c.

#define MCR_OUT2   0x08 /* Master Interrupt enable (must be set on PCs) */

Definition at line 199 of file yam.c.

#define MCR_RTS   0x02 /* RTS output */

Definition at line 197 of file yam.c.

#define MSR (   iobase)    (iobase+6)

Definition at line 172 of file yam.c.

#define MSR_CTS   0x10 /* CTS input */

Definition at line 207 of file yam.c.

#define MSR_DCD   0x80 /* DCD input */

Definition at line 210 of file yam.c.

#define MSR_DCTS   0x01 /* Delta CTS input */

Definition at line 203 of file yam.c.

#define MSR_DDCD   0x08 /* Delta DCD */

Definition at line 206 of file yam.c.

#define MSR_DDSR   0x02 /* Delta DSR */

Definition at line 204 of file yam.c.

#define MSR_DRIN   0x04 /* Delta RI */

Definition at line 205 of file yam.c.

#define MSR_DSR   0x20 /* DSR input */

Definition at line 208 of file yam.c.

#define MSR_RING   0x40 /* RI input */

Definition at line 209 of file yam.c.

#define NR_PORTS   4

Definition at line 90 of file yam.c.

#define PTT_OFF   (MCR_DTR|MCR_OUT2) /* release PTT */

Definition at line 241 of file yam.c.

#define PTT_ON   (MCR_RTS|MCR_OUT2) /* activate PTT */

Definition at line 240 of file yam.c.

#define RBR (   iobase)    (iobase+0)

Definition at line 164 of file yam.c.

#define RX_DCD   MSR_DCD /* carrier detect */

Definition at line 237 of file yam.c.

#define RX_FLAG   MSR_RING /* hdlc flag received */

Definition at line 238 of file yam.c.

#define SCR (   iobase)    (iobase+7)

Definition at line 173 of file yam.c.

#define THR (   iobase)    (iobase+0)

Definition at line 165 of file yam.c.

#define TX_CRC1   3

Definition at line 98 of file yam.c.

#define TX_CRC2   4

Definition at line 99 of file yam.c.

#define TX_DATA   2

Definition at line 97 of file yam.c.

#define TX_HEAD   1

Definition at line 96 of file yam.c.

#define TX_OFF   0

Definition at line 95 of file yam.c.

#define TX_RDY   MSR_DCTS /* transmitter ready to send */

Definition at line 236 of file yam.c.

#define TX_TAIL   5

Definition at line 100 of file yam.c.

#define YAM_1200   2

Definition at line 88 of file yam.c.

#define YAM_9600   1

Definition at line 87 of file yam.c.

#define YAM_EXTENT   8

Definition at line 177 of file yam.c.

#define YAM_MAGIC   0xF10A7654

Definition at line 91 of file yam.c.

#define YAM_MAX_FRAME   1024

Definition at line 102 of file yam.c.

Enumeration Type Documentation

enum uart
Enumerator:
c_uart_unknown 
c_uart_8250 
c_uart_16450 
c_uart_16550 
c_uart_16550A 
c_uart_unknown 
c_uart_8250 
c_uart_16450 
c_uart_16550 
c_uart_16550A 
c_uart_unknown 
c_uart_8250 
c_uart_16450 
c_uart_16550 
c_uart_16550A 

Definition at line 501 of file yam.c.

Function Documentation

MODULE_AUTHOR ( "Frederic Rible F1OAT [email protected] )
MODULE_DESCRIPTION ( "Yam amateur radio modem driver )
module_exit ( yam_cleanup_driver  )
MODULE_FIRMWARE ( FIRMWARE_1200  )
MODULE_FIRMWARE ( FIRMWARE_9600  )
module_init ( yam_init_driver  )
MODULE_LICENSE ( "GPL"  )