Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
common.c File Reference
#include "gigaset.h"
#include <linux/module.h>
#include <linux/moduleparam.h>

Go to the source code of this file.

Macros

#define DRIVER_AUTHOR   "Hansjoerg Lipp <[email protected]>, Tilman Schmidt <tilman@imap.cc>, Stefan Eilers"
 
#define DRIVER_DESC   "Driver for Gigaset 307x"
 
#define DRIVER_DESC_DEBUG   ""
 
#define VALID_MINOR   0x01
 
#define VALID_ID   0x02
 

Functions

 EXPORT_SYMBOL_GPL (gigaset_debuglevel)
 
 module_param_named (debug, gigaset_debuglevel, int, S_IRUGO|S_IWUSR)
 
 MODULE_PARM_DESC (debug,"debug level")
 
void gigaset_dbg_buffer (enum debuglevel level, const unsigned char *msg, size_t len, const unsigned char *buf)
 
 EXPORT_SYMBOL_GPL (gigaset_dbg_buffer)
 
int gigaset_enterconfigmode (struct cardstate *cs)
 
int gigaset_get_channel (struct bc_state *bcs)
 
struct bc_stategigaset_get_free_channel (struct cardstate *cs)
 
void gigaset_free_channel (struct bc_state *bcs)
 
int gigaset_get_channels (struct cardstate *cs)
 
void gigaset_free_channels (struct cardstate *cs)
 
void gigaset_block_channels (struct cardstate *cs)
 
struct event_tgigaset_add_event (struct cardstate *cs, struct at_state_t *at_state, int type, void *ptr, int parameter, void *arg)
 
 EXPORT_SYMBOL_GPL (gigaset_add_event)
 
void gigaset_freecs (struct cardstate *cs)
 
 EXPORT_SYMBOL_GPL (gigaset_freecs)
 
void gigaset_at_init (struct at_state_t *at_state, struct bc_state *bcs, struct cardstate *cs, int cid)
 
int gigaset_fill_inbuf (struct inbuf_t *inbuf, const unsigned char *src, unsigned numbytes)
 
 EXPORT_SYMBOL_GPL (gigaset_fill_inbuf)
 
struct cardstategigaset_initcs (struct gigaset_driver *drv, int channels, int onechannel, int ignoreframes, int cidmode, const char *modulename)
 
 EXPORT_SYMBOL_GPL (gigaset_initcs)
 
void gigaset_bcs_reinit (struct bc_state *bcs)
 
int gigaset_start (struct cardstate *cs)
 
 EXPORT_SYMBOL_GPL (gigaset_start)
 
int gigaset_shutdown (struct cardstate *cs)
 
 EXPORT_SYMBOL_GPL (gigaset_shutdown)
 
void gigaset_stop (struct cardstate *cs)
 
 EXPORT_SYMBOL_GPL (gigaset_stop)
 
struct cardstategigaset_get_cs_by_id (int id)
 
struct cardstategigaset_get_cs_by_tty (struct tty_struct *tty)
 
void gigaset_freedriver (struct gigaset_driver *drv)
 
 EXPORT_SYMBOL_GPL (gigaset_freedriver)
 
struct gigaset_drivergigaset_initdriver (unsigned minor, unsigned minors, const char *procname, const char *devname, const struct gigaset_ops *ops, struct module *owner)
 
 EXPORT_SYMBOL_GPL (gigaset_initdriver)
 
void gigaset_blockdriver (struct gigaset_driver *drv)
 
 EXPORT_SYMBOL_GPL (gigaset_blockdriver)
 
 module_init (gigaset_init_module)
 
 module_exit (gigaset_exit_module)
 
 MODULE_AUTHOR (DRIVER_AUTHOR)
 
 MODULE_DESCRIPTION (DRIVER_DESC)
 
 MODULE_LICENSE ("GPL")
 

Variables

int gigaset_debuglevel
 

Macro Definition Documentation

#define DRIVER_AUTHOR   "Hansjoerg Lipp <[email protected]>, Tilman Schmidt <tilman@imap.cc>, Stefan Eilers"

Definition at line 21 of file common.c.

#define DRIVER_DESC   "Driver for Gigaset 307x"

Definition at line 22 of file common.c.

#define DRIVER_DESC_DEBUG   ""

Definition at line 27 of file common.c.

#define VALID_ID   0x02

Definition at line 38 of file common.c.

#define VALID_MINOR   0x01

Definition at line 37 of file common.c.

Function Documentation

EXPORT_SYMBOL_GPL ( gigaset_debuglevel  )
EXPORT_SYMBOL_GPL ( gigaset_dbg_buffer  )
EXPORT_SYMBOL_GPL ( gigaset_add_event  )
EXPORT_SYMBOL_GPL ( gigaset_freecs  )
EXPORT_SYMBOL_GPL ( gigaset_fill_inbuf  )
EXPORT_SYMBOL_GPL ( gigaset_initcs  )
EXPORT_SYMBOL_GPL ( gigaset_start  )
EXPORT_SYMBOL_GPL ( gigaset_shutdown  )
EXPORT_SYMBOL_GPL ( gigaset_stop  )
EXPORT_SYMBOL_GPL ( gigaset_freedriver  )
EXPORT_SYMBOL_GPL ( gigaset_initdriver  )
EXPORT_SYMBOL_GPL ( gigaset_blockdriver  )
struct event_t* gigaset_add_event ( struct cardstate cs,
struct at_state_t at_state,
int  type,
void ptr,
int  parameter,
void arg 
)
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

Definition at line 332 of file common.c.

void gigaset_at_init ( struct at_state_t at_state,
struct bc_state bcs,
struct cardstate cs,
int  cid 
)

Definition at line 525 of file common.c.

void gigaset_bcs_reinit ( struct bc_state bcs)

Definition at line 798 of file common.c.

void gigaset_block_channels ( struct cardstate cs)

Definition at line 284 of file common.c.

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.

Definition at line 1138 of file common.c.

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 .

Definition at line 51 of file common.c.

int gigaset_enterconfigmode ( struct cardstate cs)

Definition at line 106 of file common.c.

int gigaset_fill_inbuf ( struct inbuf_t inbuf,
const unsigned char src,
unsigned  numbytes 
)

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

Definition at line 571 of file common.c.

void gigaset_free_channel ( struct bc_state bcs)

Definition at line 232 of file common.c.

void gigaset_free_channels ( struct cardstate cs)

Definition at line 272 of file common.c.

void gigaset_freecs ( struct cardstate cs)

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.

Definition at line 460 of file common.c.

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.

Definition at line 1055 of file common.c.

int gigaset_get_channel ( struct bc_state bcs)

Definition at line 188 of file common.c.

int gigaset_get_channels ( struct cardstate cs)

Definition at line 250 of file common.c.

struct cardstate* gigaset_get_cs_by_id ( int  id)
read

Definition at line 993 of file common.c.

struct cardstate* gigaset_get_cs_by_tty ( struct tty_struct tty)
read

Definition at line 1042 of file common.c.

struct bc_state* gigaset_get_free_channel ( struct cardstate cs)
read

Definition at line 206 of file common.c.

struct cardstate* gigaset_initcs ( struct gigaset_driver drv,
int  channels,
int  onechannel,
int  ignoreframes,
int  cidmode,
const char modulename 
)
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

Definition at line 674 of file common.c.

struct gigaset_driver* gigaset_initdriver ( unsigned  minor,
unsigned  minors,
const char procname,
const char devname,
const struct gigaset_ops ops,
struct module owner 
)
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.

Definition at line 1082 of file common.c.

int gigaset_shutdown ( struct cardstate cs)

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)

Definition at line 939 of file common.c.

int gigaset_start ( struct cardstate cs)

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

Definition at line 892 of file common.c.

void gigaset_stop ( struct cardstate cs)

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 971 of file common.c.

MODULE_AUTHOR ( DRIVER_AUTHOR  )
MODULE_DESCRIPTION ( DRIVER_DESC  )
module_exit ( gigaset_exit_module  )
module_init ( gigaset_init_module  )
MODULE_LICENSE ( "GPL"  )
module_param_named ( debug  ,
gigaset_debuglevel  ,
int  ,
S_IRUGO S_IWUSR 
)
MODULE_PARM_DESC ( debug  ,
"debug level  
)

Variable Documentation

int gigaset_debuglevel

Definition at line 31 of file common.c.