Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Functions
c101.c File Reference
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/capability.h>
#include <linux/slab.h>
#include <linux/types.h>
#include <linux/string.h>
#include <linux/errno.h>
#include <linux/init.h>
#include <linux/moduleparam.h>
#include <linux/netdevice.h>
#include <linux/hdlc.h>
#include <linux/delay.h>
#include <asm/io.h>
#include "hd64570.h"
#include "hd64570.c"

Go to the source code of this file.

Data Structures

struct  card_s
 

Macros

#define pr_fmt(fmt)   KBUILD_MODNAME ": " fmt
 
#define DEBUG_RINGS
 
#define C101_PAGE   0x1D00
 
#define C101_DTR   0x1E00
 
#define C101_SCA   0x1F00
 
#define C101_WINDOW_SIZE   0x2000
 
#define C101_MAPPED_RAM_SIZE   0x4000
 
#define RAM_SIZE   (256 * 1024)
 
#define TX_RING_BUFFERS   10
 
#define RX_RING_BUFFERS
 
#define CLOCK_BASE   9830400 /* 9.8304 MHz */
 
#define PAGE0_ALWAYS_MAPPED
 
#define sca_in(reg, card)   readb((card)->win0base + C101_SCA + (reg))
 
#define sca_out(value, reg, card)   writeb(value, (card)->win0base + C101_SCA + (reg))
 
#define sca_inw(reg, card)   readw((card)->win0base + C101_SCA + (reg))
 
#define sca_outw(value, reg, card)
 
#define port_to_card(port)   (port)
 
#define log_node(port)   (0)
 
#define phy_node(port)   (0)
 
#define winsize(card)   (C101_WINDOW_SIZE)
 
#define win0base(card)   ((card)->win0base)
 
#define winbase(card)   ((card)->win0base + 0x2000)
 
#define get_port(card, port)   (card)
 

Typedefs

typedef struct card_s card_t
 
typedef card_t port_t
 

Functions

 module_init (c101_init)
 
 module_exit (c101_cleanup)
 
 MODULE_AUTHOR ("Krzysztof Halasa <khc@pm.waw.pl>")
 
 MODULE_DESCRIPTION ("Moxa C101 serial port driver")
 
 MODULE_LICENSE ("GPL v2")
 
 module_param (hw, charp, 0444)
 
 MODULE_PARM_DESC (hw,"irq,ram:irq,...")
 

Macro Definition Documentation

#define C101_DTR   0x1E00

Definition at line 43 of file c101.c.

#define C101_MAPPED_RAM_SIZE   0x4000

Definition at line 46 of file c101.c.

#define C101_PAGE   0x1D00

Definition at line 42 of file c101.c.

#define C101_SCA   0x1F00

Definition at line 44 of file c101.c.

#define C101_WINDOW_SIZE   0x2000

Definition at line 45 of file c101.c.

#define CLOCK_BASE   9830400 /* 9.8304 MHz */

Definition at line 53 of file c101.c.

#define DEBUG_RINGS

Definition at line 40 of file c101.c.

#define get_port (   card,
  port 
)    (card)

Definition at line 103 of file c101.c.

#define log_node (   port)    (0)

Definition at line 98 of file c101.c.

#define PAGE0_ALWAYS_MAPPED

Definition at line 54 of file c101.c.

#define phy_node (   port)    (0)

Definition at line 99 of file c101.c.

#define port_to_card (   port)    (port)

Definition at line 97 of file c101.c.

#define pr_fmt (   fmt)    KBUILD_MODNAME ": " fmt

Definition at line 17 of file c101.c.

#define RAM_SIZE   (256 * 1024)

Definition at line 48 of file c101.c.

#define RX_RING_BUFFERS
Value:

Definition at line 50 of file c101.c.

#define sca_in (   reg,
  card 
)    readb((card)->win0base + C101_SCA + (reg))

Definition at line 87 of file c101.c.

#define sca_inw (   reg,
  card 
)    readw((card)->win0base + C101_SCA + (reg))

Definition at line 89 of file c101.c.

#define sca_out (   value,
  reg,
  card 
)    writeb(value, (card)->win0base + C101_SCA + (reg))

Definition at line 88 of file c101.c.

#define sca_outw (   value,
  reg,
  card 
)
Value:
do { \
writeb(value & 0xFF, (card)->win0base + C101_SCA + (reg)); \
writeb((value >> 8 ) & 0xFF, (card)->win0base + C101_SCA + (reg + 1));\
} while(0)

Definition at line 92 of file c101.c.

#define TX_RING_BUFFERS   10

Definition at line 49 of file c101.c.

#define win0base (   card)    ((card)->win0base)

Definition at line 101 of file c101.c.

#define winbase (   card)    ((card)->win0base + 0x2000)

Definition at line 102 of file c101.c.

#define winsize (   card)    (C101_WINDOW_SIZE)

Definition at line 100 of file c101.c.

Typedef Documentation

typedef struct card_s card_t
typedef card_t port_t

Definition at line 81 of file c101.c.

Function Documentation

MODULE_AUTHOR ( "Krzysztof Halasa <khc@pm.waw.pl>"  )
MODULE_DESCRIPTION ( "Moxa C101 serial port driver )
module_exit ( c101_cleanup  )
module_init ( c101_init  )
MODULE_LICENSE ( "GPL v2 )
module_param ( hw  ,
charp  ,
0444   
)
MODULE_PARM_DESC ( hw  ,
irq,
ram:irq  ,
..."   
)