Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
nozomi.c File Reference
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/ioport.h>
#include <linux/tty.h>
#include <linux/tty_driver.h>
#include <linux/tty_flip.h>
#include <linux/sched.h>
#include <linux/serial.h>
#include <linux/interrupt.h>
#include <linux/kmod.h>
#include <linux/init.h>
#include <linux/kfifo.h>
#include <linux/uaccess.h>
#include <linux/slab.h>
#include <asm/byteorder.h>
#include <linux/delay.h>

Go to the source code of this file.

Data Structures

struct  toggles
 
struct  config_table
 
struct  ctrl_dl
 
struct  ctrl_ul
 
struct  port
 
struct  nozomi
 
struct  buffer
 

Macros

#define DEBUG
 
#define VERSION_STRING   DRIVER_DESC " 2.1d"
 
#define NOZOMI_DEBUG_LEVEL   0x00
 
#define P_BUF_SIZE   128
 
#define NFO(_err_flag_, args...)
 
#define DBG1(args...)   D_(0x01, ##args)
 
#define DBG2(args...)   D_(0x02, ##args)
 
#define DBG3(args...)   D_(0x04, ##args)
 
#define DBG4(args...)   D_(0x08, ##args)
 
#define DBG5(args...)   D_(0x10, ##args)
 
#define DBG6(args...)   D_(0x20, ##args)
 
#define DBG7(args...)   D_(0x40, ##args)
 
#define DBG8(args...)   D_(0x80, ##args)
 
#define D(lvl, args...)
 
#define D_(lvl, args...)   D(lvl, ##args)
 
#define TMP_BUF_MAX   256
 
#define DUMP(buf__, len__)
 
#define NOZOMI_NAME   "nozomi"
 
#define NOZOMI_NAME_TTY   "nozomi_tty"
 
#define DRIVER_DESC   "Nozomi driver"
 
#define NTTY_TTY_MAXMINORS   256
 
#define NTTY_FIFO_BUFFER_SIZE   8192
 
#define FIFO_BUFFER_SIZE_UL   8192
 
#define SEND_BUF_MAX   1024
 
#define RECEIVE_BUF_MAX   4
 
#define R_IIR   0x0000 /* Interrupt Identity Register */
 
#define R_FCR   0x0000 /* Flow Control Register */
 
#define R_IER   0x0004 /* Interrupt Enable Register */
 
#define CONFIG_MAGIC   0xEFEFFEFE
 
#define TOGGLE_VALID   0x0000
 
#define MDM_DL1   0x0001
 
#define MDM_UL1   0x0002
 
#define MDM_DL2   0x0004
 
#define MDM_UL2   0x0008
 
#define DIAG_DL1   0x0010
 
#define DIAG_DL2   0x0020
 
#define DIAG_UL   0x0040
 
#define APP1_DL   0x0080
 
#define APP1_UL   0x0100
 
#define APP2_DL   0x0200
 
#define APP2_UL   0x0400
 
#define CTRL_DL   0x0800
 
#define CTRL_UL   0x1000
 
#define RESET   0x8000
 
#define MDM_DL   (MDM_DL1 | MDM_DL2)
 
#define MDM_UL   (MDM_UL1 | MDM_UL2)
 
#define DIAG_DL   (DIAG_DL1 | DIAG_DL2)
 
#define CTRL_DSR   0x0001
 
#define CTRL_DCD   0x0002
 
#define CTRL_RI   0x0004
 
#define CTRL_CTS   0x0008
 
#define CTRL_DTR   0x0001
 
#define CTRL_RTS   0x0002
 
#define MAX_PORT   4
 
#define NOZOMI_MAX_PORTS   5
 
#define NOZOMI_MAX_CARDS   (NTTY_TTY_MAXMINORS / MAX_PORT)
 

Enumerations

enum  card_type {
  UNKNOWN = -1, DC10_old, DC10_new, DC10plus,
  DC30, DC30plus, LML33, LML33R10,
  BUZ, AVS6EYES, NUM_CARDS, F32_2 = 2048,
  F32_8 = 8192, CMI8330, CMI8329, MEDIA_FX,
  SSCAPE, SSCAPE_PNP, SSCAPE_VIVO
}
 
enum  card_state { NOZOMI_STATE_UKNOWN = 0, NOZOMI_STATE_ENABLED = 1, NOZOMI_STATE_ALLOCATED = 2, NOZOMI_STATE_READY = 3 }
 
enum  channel_type { CH_A = 0, CH_B = 1 }
 
enum  ctrl_port_type {
  CTRL_CMD = 0, CTRL_MDM = 1, CTRL_DIAG = 2, CTRL_APP1 = 3,
  CTRL_APP2 = 4, CTRL_ERROR = -1
}
 
enum  port_type {
  PORT_PATA0 = 0, PORT_PATA1 = 1, PORT_SATA = 2, PORT_PATA0 = 0,
  PORT_PATA1 = 1, PORT_SATA = 2, PORT_TYPE_SAS = (1L << 1), PORT_TYPE_SATA = (1L << 0),
  PORT_MDM = 0, PORT_DIAG = 1, PORT_APP1 = 2, PORT_APP2 = 3,
  PORT_CTRL = 4, PORT_ERROR = -1
}
 

Functions

struct toggles __attribute__ ((packed))
 
 MODULE_DEVICE_TABLE (pci, nozomi_pci_tbl)
 
 module_init (nozomi_init)
 
 module_exit (nozomi_exit)
 
 module_param (debug, int, S_IRUGO|S_IWUSR)
 
 MODULE_LICENSE ("Dual BSD/GPL")
 
 MODULE_DESCRIPTION (DRIVER_DESC)
 

Variables

unsigned int mdm_ul
 
unsigned int mdm_dl
 
unsigned int diag_dl
 
unsigned int enabled
 
u32 signature
 
u16 version
 
u16 product_information
 
struct toggles toggle
 
u8 pad1 [7]
 
u16 dl_start
 
u16 dl_mdm_len1
 
u16 dl_mdm_len2
 
u16 dl_diag_len1
 
u16 dl_diag_len2
 
u16 dl_app1_len
 
u16 dl_app2_len
 
u16 dl_ctrl_len
 
u8 pad2 [16]
 
u16 ul_start
 
u16 ul_mdm_len2
 
u16 ul_mdm_len1
 
u16 ul_diag_len
 
u16 ul_app1_len
 
u16 ul_app2_len
 
u16 ul_ctrl_len
 
unsigned int DSR
 
unsigned int DCD
 
unsigned int RI
 
unsigned int CTS
 
unsigned int reserverd
 
u8 port
 
unsigned int DTR
 
unsigned int RTS
 
unsigned int reserved
 
struct port __attribute__
 
u32 size
 
u8data
 

Macro Definition Documentation

#define APP1_DL   0x0080

Definition at line 154 of file nozomi.c.

#define APP1_UL   0x0100

Definition at line 155 of file nozomi.c.

#define APP2_DL   0x0200

Definition at line 156 of file nozomi.c.

#define APP2_UL   0x0400

Definition at line 157 of file nozomi.c.

#define CONFIG_MAGIC   0xEFEFFEFE

Definition at line 143 of file nozomi.c.

#define CTRL_CTS   0x0008

Definition at line 170 of file nozomi.c.

#define CTRL_DCD   0x0002

Definition at line 168 of file nozomi.c.

#define CTRL_DL   0x0800

Definition at line 158 of file nozomi.c.

#define CTRL_DSR   0x0001

Definition at line 167 of file nozomi.c.

#define CTRL_DTR   0x0001

Definition at line 172 of file nozomi.c.

#define CTRL_RI   0x0004

Definition at line 169 of file nozomi.c.

#define CTRL_RTS   0x0002

Definition at line 173 of file nozomi.c.

#define CTRL_UL   0x1000

Definition at line 159 of file nozomi.c.

#define D (   lvl,
  args... 
)
Value:
do \
{if (lvl & debug) NFO(KERN_DEBUG, ##args); } \
while (0)

Definition at line 93 of file nozomi.c.

#define D_ (   lvl,
  args... 
)    D(lvl, ##args)

Definition at line 96 of file nozomi.c.

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

Definition at line 80 of file nozomi.c.

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

Definition at line 81 of file nozomi.c.

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

Definition at line 82 of file nozomi.c.

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

Definition at line 83 of file nozomi.c.

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

Definition at line 84 of file nozomi.c.

#define DBG6 (   args...)    D_(0x20, ##args)

Definition at line 85 of file nozomi.c.

#define DBG7 (   args...)    D_(0x40, ##args)

Definition at line 86 of file nozomi.c.

#define DBG8 (   args...)    D_(0x80, ##args)

Definition at line 87 of file nozomi.c.

#define DEBUG

Definition at line 42 of file nozomi.c.

#define DIAG_DL   (DIAG_DL1 | DIAG_DL2)

Definition at line 164 of file nozomi.c.

#define DIAG_DL1   0x0010

Definition at line 151 of file nozomi.c.

#define DIAG_DL2   0x0020

Definition at line 152 of file nozomi.c.

#define DIAG_UL   0x0040

Definition at line 153 of file nozomi.c.

#define DRIVER_DESC   "Nozomi driver"

Definition at line 126 of file nozomi.c.

#define DUMP (   buf__,
  len__ 
)
Value:
do { \
char tbuf[TMP_BUF_MAX] = {0};\
if (len__ > 1) {\
snprintf(tbuf, len__ > TMP_BUF_MAX ? TMP_BUF_MAX : len__, "%s", buf__);\
if (tbuf[len__-2] == '\r') {\
tbuf[len__-2] = 'r';\
} \
DBG1("SENDING: '%s' (%d+n)", tbuf, len__);\
} else {\
DBG1("SENDING: '%s' (%d)", tbuf, len__);\
} \
} while (0)

Definition at line 109 of file nozomi.c.

#define FIFO_BUFFER_SIZE_UL   8192

Definition at line 132 of file nozomi.c.

#define MAX_PORT   4

Definition at line 175 of file nozomi.c.

#define MDM_DL   (MDM_DL1 | MDM_DL2)

Definition at line 162 of file nozomi.c.

#define MDM_DL1   0x0001

Definition at line 147 of file nozomi.c.

#define MDM_DL2   0x0004

Definition at line 149 of file nozomi.c.

#define MDM_UL   (MDM_UL1 | MDM_UL2)

Definition at line 163 of file nozomi.c.

#define MDM_UL1   0x0002

Definition at line 148 of file nozomi.c.

#define MDM_UL2   0x0008

Definition at line 150 of file nozomi.c.

#define NFO (   _err_flag_,
  args... 
)
Value:
do { \
char tmp[P_BUF_SIZE]; \
snprintf(tmp, sizeof(tmp), ##args); \
printk(_err_flag_ "[%d] %s(): %s\n", __LINE__, \
__func__, tmp); \
} while (0)

Definition at line 72 of file nozomi.c.

#define NOZOMI_DEBUG_LEVEL   0x00

Definition at line 69 of file nozomi.c.

#define NOZOMI_MAX_CARDS   (NTTY_TTY_MAXMINORS / MAX_PORT)

Definition at line 177 of file nozomi.c.

#define NOZOMI_MAX_PORTS   5

Definition at line 176 of file nozomi.c.

#define NOZOMI_NAME   "nozomi"

Definition at line 124 of file nozomi.c.

#define NOZOMI_NAME_TTY   "nozomi_tty"

Definition at line 125 of file nozomi.c.

#define NTTY_FIFO_BUFFER_SIZE   8192

Definition at line 129 of file nozomi.c.

#define NTTY_TTY_MAXMINORS   256

Definition at line 128 of file nozomi.c.

#define P_BUF_SIZE   128

Definition at line 71 of file nozomi.c.

#define R_FCR   0x0000 /* Flow Control Register */

Definition at line 140 of file nozomi.c.

#define R_IER   0x0004 /* Interrupt Enable Register */

Definition at line 141 of file nozomi.c.

#define R_IIR   0x0000 /* Interrupt Identity Register */

Definition at line 139 of file nozomi.c.

#define RECEIVE_BUF_MAX   4

Definition at line 136 of file nozomi.c.

#define RESET   0x8000

Definition at line 160 of file nozomi.c.

#define SEND_BUF_MAX   1024

Definition at line 135 of file nozomi.c.

#define TMP_BUF_MAX   256

Definition at line 107 of file nozomi.c.

#define TOGGLE_VALID   0x0000

Definition at line 144 of file nozomi.c.

#define VERSION_STRING   DRIVER_DESC " 2.1d"

Definition at line 64 of file nozomi.c.

Enumeration Type Documentation

enum card_state
Enumerator:
NOZOMI_STATE_UKNOWN 
NOZOMI_STATE_ENABLED 
NOZOMI_STATE_ALLOCATED 
NOZOMI_STATE_READY 

Definition at line 191 of file nozomi.c.

enum card_type
Enumerator:
UNKNOWN 
DC10_old 
DC10_new 
DC10plus 
DC30 
DC30plus 
LML33 
LML33R10 
BUZ 
AVS6EYES 
NUM_CARDS 
F32_2 
F32_8 
CMI8330 
CMI8329 
MEDIA_FX 
SSCAPE 
SSCAPE_PNP 
SSCAPE_VIVO 

Definition at line 185 of file nozomi.c.

Enumerator:
CH_A 
CH_B 

Definition at line 199 of file nozomi.c.

Enumerator:
CTRL_CMD 
CTRL_MDM 
CTRL_DIAG 
CTRL_APP1 
CTRL_APP2 
CTRL_ERROR 

Definition at line 205 of file nozomi.c.

enum port_type
Enumerator:
PORT_PATA0 
PORT_PATA1 
PORT_SATA 
PORT_PATA0 
PORT_PATA1 
PORT_SATA 
PORT_TYPE_SAS 
PORT_TYPE_SATA 
PORT_MDM 
PORT_DIAG 
PORT_APP1 
PORT_APP2 
PORT_CTRL 
PORT_ERROR 

Definition at line 215 of file nozomi.c.

Function Documentation

struct toggles __attribute__ ( (packed)  )
read

mcontroller : adapter info structure for old mimd_t apps

: base address : irq number : number of logical drives : pci bus : pci device : pci function : pci id : vendor id : slot number : unique id

Definition at line 171 of file esd_usb2.c.

MODULE_DESCRIPTION ( DRIVER_DESC  )
MODULE_DEVICE_TABLE ( pci  ,
nozomi_pci_tbl   
)
module_exit ( nozomi_exit  )
module_init ( nozomi_init  )
MODULE_LICENSE ( "Dual BSD/GPL"  )
module_param ( debug  ,
int  ,
S_IRUGO S_IWUSR 
)

Variable Documentation

unsigned int CTS

Definition at line 344 of file nozomi.c.

u8* data

Definition at line 402 of file nozomi.c.

unsigned int DCD

Definition at line 342 of file nozomi.c.

unsigned int diag_dl

Definition at line 305 of file nozomi.c.

u16 dl_app1_len

Definition at line 344 of file nozomi.c.

u16 dl_app2_len

Definition at line 345 of file nozomi.c.

u16 dl_ctrl_len

Definition at line 346 of file nozomi.c.

u16 dl_diag_len1

Definition at line 342 of file nozomi.c.

u16 dl_diag_len2

Definition at line 343 of file nozomi.c.

u16 dl_mdm_len1

Definition at line 337 of file nozomi.c.

u16 dl_mdm_len2

Definition at line 341 of file nozomi.c.

u16 dl_start

Definition at line 336 of file nozomi.c.

unsigned int DSR

Definition at line 341 of file nozomi.c.

unsigned int DTR

Definition at line 349 of file nozomi.c.

unsigned int enabled

Definition at line 306 of file nozomi.c.

unsigned int mdm_dl

Definition at line 304 of file nozomi.c.

unsigned int mdm_ul

Definition at line 303 of file nozomi.c.

u8 pad1[7]

Definition at line 335 of file nozomi.c.

u8 pad2[16]

Definition at line 347 of file nozomi.c.

Definition at line 346 of file nozomi.c.

u16 product_information

Definition at line 333 of file nozomi.c.

unsigned int reserved

Definition at line 351 of file nozomi.c.

unsigned int reserverd

Definition at line 345 of file nozomi.c.

unsigned int RI

Definition at line 343 of file nozomi.c.

unsigned int RTS

Definition at line 350 of file nozomi.c.

u32 signature

Definition at line 331 of file nozomi.c.

u32 size

Definition at line 401 of file nozomi.c.

struct toggles toggle

Definition at line 334 of file nozomi.c.

u16 ul_app1_len

Definition at line 352 of file nozomi.c.

u16 ul_app2_len

Definition at line 353 of file nozomi.c.

u16 ul_ctrl_len

Definition at line 354 of file nozomi.c.

u16 ul_diag_len

Definition at line 351 of file nozomi.c.

u16 ul_mdm_len1

Definition at line 350 of file nozomi.c.

u16 ul_mdm_len2

Definition at line 349 of file nozomi.c.

u16 ul_start

Definition at line 348 of file nozomi.c.

u16 version

Definition at line 332 of file nozomi.c.