Main Page | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

elsa_ser.c File Reference

#include <linux/config.h>
#include <linux/serial.h>
#include <linux/serial_reg.h>

Include dependency graph for elsa_ser.c:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define MAX_MODEM_BUF   256
#define WAKEUP_CHARS   (MAX_MODEM_BUF/2)
#define RS_ISR_PASS_LIMIT   256
#define BASE_BAUD   ( 1843200 / 16 )
#define MIN(a, b)   ((a) < (b) ? (a) : (b))
#define RCV_DELAY   20000
#define RCV_DELAY   20000

Functions

static unsigned int serial_in (struct IsdnCardState *cs, int offset)
static unsigned int serial_inp (struct IsdnCardState *cs, int offset)
static void serial_out (struct IsdnCardState *cs, int offset, int value)
static void serial_outp (struct IsdnCardState *cs, int offset, int value)
static void change_speed (struct IsdnCardState *cs, int baud)
static int mstartup (struct IsdnCardState *cs)
static void mshutdown (struct IsdnCardState *cs)
int write_modem (struct BCState *bcs)
void modem_fill (struct BCState *bcs)
static void receive_chars (struct IsdnCardState *cs, int *status)
static void transmit_chars (struct IsdnCardState *cs, int *intr_done)
static void rs_interrupt_elsa (int irq, struct IsdnCardState *cs)
int open_hscxstate (struct IsdnCardState *cs, struct BCState *bcs)
void modehscx (struct BCState *bcs, int mode, int bc)
void hscx_l2l1 (struct PStack *st, int pr, void *arg)
void close_elsastate (struct BCState *bcs)
void modem_write_cmd (struct IsdnCardState *cs, u_char *buf, int len)
void modem_set_init (struct IsdnCardState *cs)
void modem_set_dial (struct IsdnCardState *cs, int outgoing)
void modem_l2l1 (struct PStack *st, int pr, void *arg)
int setstack_elsa (struct PStack *st, struct BCState *bcs)
void init_modem (struct IsdnCardState *cs)
void release_modem (struct IsdnCardState *cs)

Variables

static char * MInit_1 = "AT&F&C1E0&D2\r\0"
static char * MInit_2 = "ATL2M1S64=13\r\0"
static char * MInit_3 = "AT+FCLASS=0\r\0"
static char * MInit_4 = "ATV1S2=128X1\r\0"
static char * MInit_5 = "AT\\V8\\N3\r\0"
static char * MInit_6 = "ATL0M0&G0%E1\r\0"
static char * MInit_7 = "AT%L1%M0%C3\r\0"
static char * MInit_speed28800 = "AT%G0%B28800\r\0"
static char * MInit_dialout = "ATs7=60 x1 d\r\0"
static char * MInit_dialin = "ATs7=60 x1 a\r\0"


Define Documentation

#define BASE_BAUD   ( 1843200 / 16 )
 

Definition at line 17 of file elsa_ser.c.

#define MAX_MODEM_BUF   256
 

Definition at line 14 of file elsa_ser.c.

Referenced by init_modem(), modem_write_cmd(), receive_chars(), transmit_chars(), and write_modem().

#define MIN a,
 )     ((a) < (b) ? (a) : (b))
 

Definition at line 20 of file elsa_ser.c.

#define RCV_DELAY   20000
 

#define RCV_DELAY   20000
 

Referenced by modem_set_dial(), and modem_set_init().

#define RS_ISR_PASS_LIMIT   256
 

Definition at line 16 of file elsa_ser.c.

#define WAKEUP_CHARS   (MAX_MODEM_BUF/2)
 

Definition at line 15 of file elsa_ser.c.


Function Documentation

static void change_speed struct IsdnCardState *  cs,
int  baud
[static]
 

Definition at line 112 of file elsa_ser.c.

References BASE_BAUD, cli, debugl1(), restore_flags, save_flags, serial_inp, serial_outp, UART_DLL, UART_DLM, UART_FCR, UART_FCR_ENABLE_FIFO, UART_FCR_TRIGGER_1, UART_FCR_TRIGGER_8, UART_IER, UART_IER_MSI, UART_LCR, UART_LCR_DLAB, UART_RX, and xff.

Here is the call graph for this function:

void close_elsastate struct BCState *  bcs  ) 
 

Definition at line 442 of file elsa_ser.c.

References dev_kfree_skb, kfree(), modehscx(), NULL, and test_and_clear_bit.

Referenced by init_modem().

Here is the call graph for this function:

void hscx_l2l1 struct PStack *  st,
int  pr,
void *  arg
 

Definition at line 104 of file hscx.c.

References cli, CONFIRM, INDICATION, KERN_WARNING, l1_msg_b(), modehscx(), NULL, PH_ACTIVATE, PH_DATA, PH_DEACTIVATE, PH_PULL, printk, REQUEST, restore_flags, save_flags, test_and_clear_bit, and test_and_set_bit.

Referenced by setstack_elsa(), and setstack_hscx().

Here is the call graph for this function:

void init_modem struct IsdnCardState *  cs  ) 
 

Definition at line 647 of file elsa_ser.c.

References close_elsastate(), KERN_WARNING, kfree(), kmalloc(), MAX_MODEM_BUF, modem_set_init(), mstartup(), NULL, printk, and setstack_elsa().

Referenced by Elsa_card_msg().

Here is the call graph for this function:

void modehscx struct BCState *  bcs,
int  mode,
int  bc
 

Definition at line 41 of file hscx.c.

Referenced by close_elsastate(), close_hscxstate(), hscx_l2l1(), and inithscx().

void modem_fill struct BCState *  bcs  )  [inline]
 

Definition at line 299 of file elsa_ser.c.

References B_XMTBUFREADY, dev_kfree_skb, hscx_sched_event(), NULL, test_and_clear_bit, test_and_set_bit, and write_modem().

Referenced by transmit_chars().

Here is the call graph for this function:

void modem_l2l1 struct PStack *  st,
int  pr,
void *  arg
 

Definition at line 575 of file elsa_ser.c.

References arcofi_fsm(), ARCOFI_START, ARCOFI_XOP_0, cli, CONFIRM, interruptible_sleep_on(), KERN_WARNING, modem_set_dial(), mstartup(), NULL, PH_ACTIVATE, PH_DATA, PH_DEACTIVATE, printk, REQUEST, restore_flags, save_flags, set_arcofi(), test_and_clear_bit, test_and_set_bit, test_bit, and write_modem().

Referenced by setstack_elsa().

Here is the call graph for this function:

void modem_set_dial struct IsdnCardState *  cs,
int  outgoing
 

Definition at line 549 of file elsa_ser.c.

References debugl1(), MInit_dialin, MInit_dialout, MInit_speed28800, modem_write_cmd(), RCV_DELAY, restore_flags, save_flags, sti, strlen, timeout, and udelay.

Referenced by modem_l2l1().

Here is the call graph for this function:

void modem_set_init struct IsdnCardState *  cs  ) 
 

Definition at line 496 of file elsa_ser.c.

References debugl1(), MInit_1, MInit_2, MInit_3, MInit_4, MInit_5, MInit_6, MInit_7, modem_write_cmd(), RCV_DELAY, restore_flags, save_flags, sti, strlen, timeout, and udelay.

Referenced by init_modem().

Here is the call graph for this function:

void modem_write_cmd struct IsdnCardState *  cs,
u_char buf,
int  len
 

Definition at line 462 of file elsa_ser.c.

References cli, count, fp, MAX_MODEM_BUF, memcpy, MIN, msg(), restore_flags, save_flags, serial_outp, u_char, UART_IER, and UART_IER_THRI.

Referenced by Elsa_card_msg(), modem_set_dial(), and modem_set_init().

Here is the call graph for this function:

static void mshutdown struct IsdnCardState *  cs  )  [static]
 

Definition at line 222 of file elsa_ser.c.

References cli, KERN_DEBUG, printk, restore_flags, save_flags, serial_inp, serial_outp, UART_FCR, UART_FCR_CLEAR_RCVR, UART_FCR_CLEAR_XMIT, UART_IER, UART_LCR, UART_LCR_SBC, UART_MCR, UART_MCR_DTR, UART_MCR_OUT2, UART_MCR_RTS, UART_RX, and x00.

Referenced by release_modem().

static int mstartup struct IsdnCardState *  cs  )  [static]
 

Definition at line 151 of file elsa_ser.c.

References BASE_BAUD, change_speed(), cli, ENODEV, restore_flags, save_flags, serial_inp, serial_outp, UART_FCR, UART_FCR_CLEAR_RCVR, UART_FCR_CLEAR_XMIT, UART_IER, UART_IER_MSI, UART_IER_RDI, UART_IER_RLSI, UART_IIR, UART_LCR, UART_LCR_WLEN8, UART_LSR, UART_MCR, UART_MCR_DTR, UART_MCR_OUT2, UART_MCR_RTS, UART_MSR, UART_RX, and xff.

Referenced by init_modem(), and modem_l2l1().

Here is the call graph for this function:

int open_hscxstate struct IsdnCardState *  cs,
struct BCState *  bcs
 

Definition at line 182 of file hscx.c.

References KERN_WARNING, kfree(), kmalloc(), NULL, printk, test_and_clear_bit, and test_and_set_bit.

Referenced by setstack_elsa(), and setstack_hscx().

Here is the call graph for this function:

static void receive_chars struct IsdnCardState *  cs,
int *  status
[inline, static]
 

Definition at line 324 of file elsa_ser.c.

References B_RCVBUFREADY, debugl1(), hscx_sched_event(), KERN_WARNING, MAX_MODEM_BUF, memcpy, printk, QuickHex(), serial_in, serial_inp, sprintf(), t, tmp, UART_LSR, UART_LSR_BI, UART_LSR_DR, UART_LSR_FE, UART_LSR_OE, UART_LSR_PE, and UART_RX.

Here is the call graph for this function:

void release_modem struct IsdnCardState *  cs  ) 
 

Definition at line 674 of file elsa_ser.c.

References kfree(), mshutdown(), and NULL.

Referenced by release_io_elsa().

Here is the call graph for this function:

static void rs_interrupt_elsa int  irq,
struct IsdnCardState *  cs
[static]
 

Definition at line 402 of file elsa_ser.c.

References debugl1(), iir, printk, receive_chars(), RS_ISR_PASS_LIMIT, serial_inp, status, transmit_chars(), UART_IIR, UART_IIR_NO_INT, UART_LSR, UART_LSR_DR, UART_LSR_THRE, UART_MSR, and xf.

Referenced by elsa_interrupt(), and elsa_interrupt_ipac().

Here is the call graph for this function:

static unsigned int serial_in struct IsdnCardState *  cs,
int  offset
[inline, static]
 

Definition at line 52 of file elsa_ser.c.

References debugl1(), inb, u_int, and val.

Here is the call graph for this function:

static unsigned int serial_inp struct IsdnCardState *  cs,
int  offset
[inline, static]
 

Definition at line 63 of file elsa_ser.c.

References debugl1(), inb, inb_p, u_int, and val.

Here is the call graph for this function:

static void serial_out struct IsdnCardState *  cs,
int  offset,
int  value
[inline, static]
 

Definition at line 83 of file elsa_ser.c.

References debugl1(), and outb.

Here is the call graph for this function:

static void serial_outp struct IsdnCardState *  cs,
int  offset,
int  value
[inline, static]
 

Definition at line 91 of file elsa_ser.c.

References debugl1(), outb, and outb_p.

Here is the call graph for this function:

int setstack_elsa struct PStack *  st,
struct BCState *  bcs
 

Definition at line 612 of file elsa_ser.c.

References hscx_l2l1(), modem_l2l1(), NULL, open_hscxstate(), setstack_l1_B(), setstack_manager(), test_and_clear_bit, and test_and_set_bit.

Referenced by init_modem().

Here is the call graph for this function:

static void transmit_chars struct IsdnCardState *  cs,
int *  intr_done
[inline, static]
 

Definition at line 367 of file elsa_ser.c.

References count, debugl1(), MAX_MODEM_BUF, modem_fill(), printk, serial_out, serial_outp, UART_IER, UART_IER_THRI, UART_TX, and WAKEUP_CHARS.

Here is the call graph for this function:

int write_modem struct BCState *  bcs  )  [inline]
 

Definition at line 259 of file elsa_ser.c.

References cli, count, fp, len, MAX_MODEM_BUF, memcpy, MIN, restore_flags, ret, save_flags, serial_outp, UART_IER, and UART_IER_THRI.

Referenced by modem_fill(), and modem_l2l1().


Variable Documentation

char* MInit_1 = "AT&F&C1E0&D2\r\0" [static]
 

Definition at line 38 of file elsa_ser.c.

Referenced by modem_set_init().

char* MInit_2 = "ATL2M1S64=13\r\0" [static]
 

Definition at line 39 of file elsa_ser.c.

Referenced by modem_set_init().

char* MInit_3 = "AT+FCLASS=0\r\0" [static]
 

Definition at line 40 of file elsa_ser.c.

Referenced by modem_set_init().

char* MInit_4 = "ATV1S2=128X1\r\0" [static]
 

Definition at line 41 of file elsa_ser.c.

Referenced by modem_set_init().

char* MInit_5 = "AT\\V8\\N3\r\0" [static]
 

Definition at line 42 of file elsa_ser.c.

Referenced by modem_set_init().

char* MInit_6 = "ATL0M0&G0%E1\r\0" [static]
 

Definition at line 43 of file elsa_ser.c.

Referenced by modem_set_init().

char* MInit_7 = "AT%L1%M0%C3\r\0" [static]
 

Definition at line 44 of file elsa_ser.c.

Referenced by modem_set_init().

char* MInit_dialin = "ATs7=60 x1 a\r\0" [static]
 

Definition at line 49 of file elsa_ser.c.

Referenced by modem_set_dial().

char* MInit_dialout = "ATs7=60 x1 d\r\0" [static]
 

Definition at line 48 of file elsa_ser.c.

Referenced by modem_set_dial().

char* MInit_speed28800 = "AT%G0%B28800\r\0" [static]
 

Definition at line 46 of file elsa_ser.c.

Referenced by modem_set_dial().