Linux Kernel
3.7.1
|
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/compiler.h>
#include <linux/types.h>
#include <linux/ctype.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
#include <linux/skbuff.h>
#include <linux/netdevice.h>
#include <linux/ppp_defs.h>
#include <linux/timer.h>
#include <linux/interrupt.h>
#include <linux/tty.h>
#include <linux/tty_driver.h>
#include <linux/list.h>
#include <linux/atomic.h>
Go to the source code of this file.
Data Structures | |
struct | reply_t |
struct | inbuf_t |
struct | isowbuf_t |
struct | isow_urbctx_t |
struct | at_state_t |
struct | event_t |
struct | bc_state |
struct | cardstate |
struct | gigaset_driver |
struct | cmdbuf_t |
struct | bas_bc_state |
struct | gigaset_ops |
Macros | |
#define | pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
#define | GIG_VERSION {0, 5, 0, 0} |
#define | GIG_COMPAT {0, 4, 0, 0} |
#define | MAX_REC_PARAMS 10 /* Max. number of params in response string */ |
#define | MAX_RESP_SIZE 511 /* Max. size of a response string */ |
#define | MAX_EVENTS 64 /* size of event queue */ |
#define | RBUFSIZE 8192 |
#define | GIG_TICK 100 /* in milliseconds */ |
#define | INIT_TIMEOUT 1 |
#define | RING_TIMEOUT 3 /* for additional parameters to RING */ |
#define | BAS_TIMEOUT 20 /* for response to Base USB ops */ |
#define | ATRDY_TIMEOUT 3 /* for HD_READY_SEND_ATDATA */ |
#define | BAS_RETRY 3 /* max. retries for base USB ops */ |
#define | MAXACT 3 |
#define | gig_dbg(level, format, arg...) do {} while (0) |
#define | DEBUG_DEFAULT 0 |
#define | ZSAU_NONE 0 |
#define | ZSAU_DISCONNECT_IND 4 |
#define | ZSAU_OUTGOING_CALL_PROCEEDING 1 |
#define | ZSAU_PROCEEDING 1 |
#define | ZSAU_CALL_DELIVERED 2 |
#define | ZSAU_ACTIVE 3 |
#define | ZSAU_NULL 5 |
#define | ZSAU_DISCONNECT_REQ 6 |
#define | ZSAU_UNKNOWN -1 |
#define | OUT_VENDOR_REQ (USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_ENDPOINT) |
#define | IN_VENDOR_REQ (USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_ENDPOINT) |
#define | HD_B1_FLOW_CONTROL 0x80 |
#define | HD_B2_FLOW_CONTROL 0x81 |
#define | HD_RECEIVEATDATA_ACK (0x35) /* 3070 */ |
#define | HD_READY_SEND_ATDATA (0x36) /* 3070 */ |
#define | HD_OPEN_ATCHANNEL_ACK (0x37) /* 3070 */ |
#define | HD_CLOSE_ATCHANNEL_ACK (0x38) /* 3070 */ |
#define | HD_DEVICE_INIT_OK (0x11) /* ISurf USB + 3070 */ |
#define | HD_OPEN_B1CHANNEL_ACK (0x51) /* ISurf USB + 3070 */ |
#define | HD_OPEN_B2CHANNEL_ACK (0x52) /* ISurf USB + 3070 */ |
#define | HD_CLOSE_B1CHANNEL_ACK (0x53) /* ISurf USB + 3070 */ |
#define | HD_CLOSE_B2CHANNEL_ACK (0x54) /* ISurf USB + 3070 */ |
#define | HD_SUSPEND_END (0x61) /* ISurf USB */ |
#define | HD_RESET_INTERRUPT_PIPE_ACK (0xFF) /* ISurf USB + 3070 */ |
#define | HD_OPEN_B1CHANNEL (0x23) /* ISurf USB + 3070 */ |
#define | HD_CLOSE_B1CHANNEL (0x24) /* ISurf USB + 3070 */ |
#define | HD_OPEN_B2CHANNEL (0x25) /* ISurf USB + 3070 */ |
#define | HD_CLOSE_B2CHANNEL (0x26) /* ISurf USB + 3070 */ |
#define | HD_RESET_INTERRUPT_PIPE (0x27) /* ISurf USB + 3070 */ |
#define | HD_DEVICE_INIT_ACK (0x34) /* ISurf USB + 3070 */ |
#define | HD_WRITE_ATMESSAGE (0x12) /* 3070 */ |
#define | HD_READ_ATMESSAGE (0x13) /* 3070 */ |
#define | HD_OPEN_ATCHANNEL (0x28) /* 3070 */ |
#define | HD_CLOSE_ATCHANNEL (0x29) /* 3070 */ |
#define | BAS_CHANNELS 2 |
#define | BAS_FRAMETIME 1 /* number of milliseconds between frames */ |
#define | BAS_NUMFRAMES 8 /* number of frames per URB */ |
#define | BAS_MAXFRAME 16 /* allocated bytes per frame */ |
#define | BAS_NORMFRAME 8 /* send size without flow control */ |
#define | BAS_HIGHFRAME 10 /* " " with positive flow control */ |
#define | BAS_LOWFRAME 5 /* " " with negative flow control */ |
#define | BAS_CORRFRAMES 4 /* flow control multiplicator */ |
#define | BAS_INBUFSIZE |
#define | BAS_OUTBUFSIZE 4096 /* size of common isoc out buffer */ |
#define | BAS_OUTBUFPAD BAS_MAXFRAME /* size of pad area for isoc out buf */ |
#define | BAS_INURBS 3 |
#define | BAS_OUTURBS 3 |
#define | AT_ISO 0 |
#define | AT_DIAL 1 |
#define | AT_MSN 2 |
#define | AT_BC 3 |
#define | AT_PROTO 4 |
#define | AT_TYPE 5 |
#define | AT_CLIP 6 |
#define | AT_NUM 7 |
#define | VAR_ZSAU 0 |
#define | VAR_ZDLE 1 |
#define | VAR_ZCTP 2 |
#define | VAR_NUM 3 |
#define | STR_NMBR 0 |
#define | STR_ZCPN 1 |
#define | STR_ZCON 2 |
#define | STR_ZBC 3 |
#define | STR_ZHLC 4 |
#define | STR_NUM 5 |
#define | EV_TIMEOUT -105 |
#define | EV_IF_VER -106 |
#define | EV_PROC_CIDMODE -107 |
#define | EV_SHUTDOWN -108 |
#define | EV_START -110 |
#define | EV_STOP -111 |
#define | EV_IF_LOCK -112 |
#define | EV_ACCEPT -114 |
#define | EV_DIAL -115 |
#define | EV_HUP -116 |
#define | EV_BC_OPEN -117 |
#define | EV_BC_CLOSED -118 |
#define | INS_command 0x0001 /* receiving messages (not payload data) */ |
#define | INS_DLE_char 0x0002 /* DLE flag received (in DLE mode) */ |
#define | INS_byte_stuff 0x0004 |
#define | INS_have_data 0x0008 |
#define | INS_DLE_command 0x0020 /* DLE message start (<DLE> X) received */ |
#define | INS_flag_hunt 0x0040 |
#define | CHS_D_UP 0x01 |
#define | CHS_B_UP 0x02 |
#define | CHS_NOTIFY_LL 0x04 |
#define | ICALL_REJECT 0 |
#define | ICALL_ACCEPT 1 |
#define | ICALL_IGNORE 2 |
#define | MS_UNINITIALIZED 0 |
#define | MS_INIT 1 |
#define | MS_LOCKED 2 |
#define | MS_SHUTDOWN 3 |
#define | MS_RECOVER 4 |
#define | MS_READY 5 |
#define | M_UNKNOWN 0 |
#define | M_CONFIG 1 |
#define | M_UNIMODEM 2 |
#define | M_CID 3 |
#define | SM_LOCKED 0 |
#define | SM_ISDN 1 /* default */ |
#define | L2_BITSYNC 0 |
#define | L2_HDLC 1 |
#define | L2_VOICE 2 |
#define | DLE_FLAG 0x10 |
Enumerations | |
enum | debuglevel { DEBUG_INTR = 0x00008, DEBUG_CMD = 0x00020, DEBUG_STREAM = 0x00040, DEBUG_STREAM_DUMP = 0x00080, DEBUG_LLDATA = 0x00100, DEBUG_EVENT = 0x00200, DEBUG_HDLC = 0x00800, DEBUG_CHANNEL = 0x01000, DEBUG_TRANSCMD = 0x02000, DEBUG_MCMD = 0x04000, DEBUG_INIT = 0x08000, DEBUG_SUSPEND = 0x10000, DEBUG_OUTPUT = 0x20000, DEBUG_ISO = 0x40000, DEBUG_IF = 0x80000, DEBUG_USBREQ = 0x100000, DEBUG_LOCKCMD = 0x200000, DEBUG_ANY = 0x3fffff } |
Variables | |
int | gigaset_debuglevel |
struct reply_t | gigaset_tab_cid [] |
struct reply_t | gigaset_tab_nocid [] |
#define ATRDY_TIMEOUT 3 /* for HD_READY_SEND_ATDATA */ |
#define BAS_FRAMETIME 1 /* number of milliseconds between frames */ |
#define BAS_HIGHFRAME 10 /* " " with positive flow control */ |
#define BAS_INBUFSIZE |
#define BAS_LOWFRAME 5 /* " " with negative flow control */ |
#define HD_CLOSE_B1CHANNEL_ACK (0x53) /* ISurf USB + 3070 */ |
#define HD_CLOSE_B2CHANNEL_ACK (0x54) /* ISurf USB + 3070 */ |
#define HD_OPEN_B1CHANNEL_ACK (0x51) /* ISurf USB + 3070 */ |
#define HD_OPEN_B2CHANNEL_ACK (0x52) /* ISurf USB + 3070 */ |
#define HD_RESET_INTERRUPT_PIPE (0x27) /* ISurf USB + 3070 */ |
#define HD_RESET_INTERRUPT_PIPE_ACK (0xFF) /* ISurf USB + 3070 */ |
#define IN_VENDOR_REQ (USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_ENDPOINT) |
#define INS_command 0x0001 /* receiving messages (not payload data) */ |
#define INS_DLE_char 0x0002 /* DLE flag received (in DLE mode) */ |
#define INS_DLE_command 0x0020 /* DLE message start (<DLE> X) received */ |
#define OUT_VENDOR_REQ (USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_ENDPOINT) |
#define RING_TIMEOUT 3 /* for additional parameters to RING */ |
enum debuglevel |
|
read |
gigaset_add_event() - add event to device event queue : device descriptor structure. : connection state structure. : event type. : pointer parameter for event. : integer parameter for event.
Allocate an event queue entry from the device's event queue, and set it up with the parameters given.
Return value: added event
void gigaset_blockdriver | ( | struct gigaset_driver * | drv | ) |
gigaset_blockdriver() - block driver : driver descriptor structure.
Prevents the driver from attaching new devices, in preparation for deregistration.
void gigaset_dbg_buffer | ( | enum debuglevel | level, |
const unsigned char * | msg, | ||
size_t | len, | ||
const unsigned char * | buf | ||
) |
gigaset_dbg_buffer() - dump data in ASCII and hex for debugging : debugging level. : message prefix. : number of bytes to dump. : data to dump.
If the current debugging level includes one of the bits set in , bytes starting at are logged to dmesg at KERN_DEBUG prio, prefixed by the text .
gigaset_fill_inbuf() - append received data to input buffer : buffer structure. : received data. : number of bytes received.
Return value: !=0 if some data was appended
gigaset_freecs() - free all associated ressources of a device : device descriptor structure.
Stops all tasklets and timers, unregisters the device from all subsystems it was registered to, deallocates the device structure and all structures referenced from it. Operations on the device should be stopped before calling this.
void gigaset_freedriver | ( | struct gigaset_driver * | drv | ) |
gigaset_freedriver() - free all associated ressources of a driver : driver descriptor structure.
Unregisters the driver from the system and deallocates the driver structure and all structures referenced from it. All devices should be shut down before calling this.
|
read |
Definition at line 1840 of file ev-layer.c.
gigaset_handle_modem_response() - process received modem response : device descriptor structure.
Called by asyncdata/isocdata if a block of data received from the device must be processed as a modem command response. The data is already in the cs structure.
Definition at line 416 of file ev-layer.c.
Definition at line 539 of file interface.c.
void gigaset_if_freedriver | ( | struct gigaset_driver * | drv | ) |
Definition at line 625 of file interface.c.
Definition at line 516 of file interface.c.
void gigaset_if_initdriver | ( | struct gigaset_driver * | drv, |
const char * | procname, | ||
const char * | devname | ||
) |
Definition at line 585 of file interface.c.
gigaset_if_receive() - pass a received block of data to the tty device : device descriptor structure. : received data. : number of bytes received.
Called by asyncdata/isocdata if a block of data received from the device must be sent to userspace through the ttyG* device.
Definition at line 562 of file interface.c.
|
read |
gigaset_initcs() - initialize device structure : hardware driver the device belongs to : number of B channels supported by device : !=0 if B channel data and AT commands share one communication channel (M10x), ==0 if B channels have separate communication channels (base) : number of frames to ignore after setting up B channel : !=0: start in CallID mode : name of driver module for LL registration
Allocate and initialize cardstate structure for Gigaset driver Calls hardware dependent gigaset_initcshw() function Calls B channel initialization function gigaset_initbcs() for each B channel
Return value: pointer to cardstate structure
|
read |
gigaset_initdriver() - initialize driver structure : First minor number : Number of minors this driver can handle : Name of the driver : Name of the device files (prefix without minor number)
Allocate and initialize gigaset_driver structure. Initialize interface.
Return value: Pointer to the gigaset_driver structure on success, NULL on failure.
gigaset_isdn_connB() - signal B channel connect : B channel descriptor structure.
Called by main module at tasklet level to notify the LL that the B channel connection has been established.
gigaset_isdn_connB() - signal B channel connect : B channel descriptor structure.
Called by main module to notify the LL that the B channel connection has been established.
gigaset_isdn_connD() - signal D channel connect : B channel descriptor structure.
Called by main module at tasklet level to notify the LL that the D channel connection has been established.
gigaset_isdn_connD() - signal D channel connect : B channel descriptor structure.
Called by main module to notify the LL that the D channel connection has been established.
gigaset_isdn_hupB() - signal B channel hangup : B channel descriptor structure.
Called by main module to notify the LL that the B channel connection has been shut down.
gigaset_isdn_hupD() - signal D channel hangup : B channel descriptor structure.
Called by main module at tasklet level to notify the LL that the D channel connection has been shut down.
gigaset_isdn_hupD() - signal D channel hangup : B channel descriptor structure.
Called by main module to notify the LL that the D channel connection has been shut down.
int gigaset_isdn_icall | ( | struct at_state_t * | at_state | ) |
gigaset_isdn_icall() - signal incoming call : connection state structure.
Called by main module at tasklet level to notify the LL that an incoming call has been received. contains the parameters of the call.
Return value: call disposition (ICALL_*)
gigaset_isdn_icall() - signal incoming call : connection state structure.
Called by main module to notify the LL that an incoming call has been received. contains the parameters of the call.
Return value: call disposition (ICALL_*)
gigaset_isdn_rcv_err() - signal receive error : B channel descriptor structure.
Called by hardware module {bas,ser,usb}_gigaset when a receive error has occurred, for signalling to the LL.
gigaset_isdn_regdev() - register device to LL : device descriptor structure. : device name.
Return value: 0 on success, error code < 0 on failure
gigaset_isdn_regdev() - register to LL : device descriptor structure. : device name.
Return value: 0 on success, error code < 0 on failure
gigaset_isdn_regdrv() - register driver to LL
gigaset_isdn_start() - signal device availability : device descriptor structure.
Called by main module to notify the LL that the device is available for use.
gigaset_isdn_stop() - signal device unavailability : device descriptor structure.
Called by main module to notify the LL that the device is no longer available for use.
gigaset_isdn_unregdev() - unregister device from LL : device descriptor structure.
gigaset_isdn_unregdrv() - unregister driver from LL
Definition at line 480 of file isocdata.c.
Definition at line 941 of file isocdata.c.
Definition at line 874 of file isocdata.c.
gigaset_isoc_send_skb() - queue an skb for sending : B channel descriptor structure. : data to send.
Called by LL to queue an skb for sending, and start transmission if necessary. Once the payload data has been transmitted completely, gigaset_skb_sent() will be called with the skb's link layer header preserved.
Return value: number of bytes accepted for sending (skb->len) if ok, error code < 0 (eg. -ENODEV) on error
Definition at line 989 of file isocdata.c.
Definition at line 134 of file isocdata.c.
Definition at line 24 of file isocdata.c.
gigaset_m10x_input() - process a block of data received from the device : received data and device descriptor structure.
Called by hardware module {ser,usb}_gigaset with a block of received bytes. Separates the bytes received over the serial data channel into user data and command replies (locked/unlocked) according to the current state of the interface.
Definition at line 407 of file asyncdata.c.
gigaset_m10x_send_skb() - queue an skb for sending : B channel descriptor structure. : data to send.
Called by LL to encode and queue an skb for sending, and start transmission if necessary. Once the payload data has been transmitted completely, gigaset_skb_sent() will be called with the skb's link layer header preserved.
Return value: number of bytes accepted for sending (skb->len) if ok, error code < 0 (eg. -ENOMEM) on error
Definition at line 585 of file asyncdata.c.
gigaset_shutdown() - shut down device operations : device descriptor structure.
Deactivates the device by scheduling an EV_SHUTDOWN event and waiting for completion of the shutdown.
Return value: 0 - success, -ENODEV - error (no device associated)
gigaset_skb_rcvd() - pass received skb to LL : B channel descriptor structure. : received data.
Called by hardware module {bas,ser,usb}_gigaset when user data has been successfully received, for passing to the LL. Warning: skb must not be accessed anymore!
gigaset_skb_sent() - acknowledge transmission of outgoing skb : B channel descriptor structure. : sent data.
Called by hardware module {bas,ser,usb}_gigaset when the data in a skb has been successfully sent, for signalling completion to the LL.
gigaset_skb_sent() - acknowledge sending an skb : B channel descriptor structure. : sent data.
Called by hardware module {bas,ser,usb}_gigaset when the data in a skb has been successfully sent, for signalling completion to the LL.
gigaset_start() - start device operations : device descriptor structure.
Prepares the device for use by setting up communication parameters, scheduling an EV_START event to initiate device initialization, and waiting for completion of the initialization.
Return value: 0 on success, error code < 0 on failure
gigaset_stop() - stop device operations : device descriptor structure.
Stops operations on the device by scheduling an EV_STOP event and waiting for completion of the shutdown.
Definition at line 259 of file ev-layer.c.
Definition at line 150 of file ev-layer.c.