Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 150296
b: refs/heads/master
c: 82d0481
h: refs/heads/master
v: v3
  • Loading branch information
David S. Miller committed May 18, 2009
1 parent 336f37c commit 33f70b3
Show file tree
Hide file tree
Showing 63 changed files with 1,772 additions and 536 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d3707d9918d47c0997a6b1e4ae24e7ab55e43796
refs/heads/master: 82d048186e403f36e083b37ad42aa90abb7dcaac
42 changes: 20 additions & 22 deletions trunk/Documentation/isdn/README.gigaset
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,8 @@ GigaSet 307x Device Driver
configuration files and chat scripts in the gigaset-VERSION/ppp directory
in the driver packages from http://sourceforge.net/projects/gigaset307x/.
Please note that the USB drivers are not able to change the state of the
control lines (the M105 driver can be configured to use some undocumented
control requests, if you really need the control lines, though). This means
you must use "Stupid Mode" if you are using wvdial or you should use the
nocrtscts option of pppd.
control lines. This means you must use "Stupid Mode" if you are using
wvdial or you should use the nocrtscts option of pppd.
You must also assure that the ppp_async module is loaded with the parameter
flag_time=0. You can do this e.g. by adding a line like

Expand Down Expand Up @@ -190,20 +188,19 @@ GigaSet 307x Device Driver
You can also use /sys/class/tty/ttyGxy/cidmode for changing the CID mode
setting (ttyGxy is ttyGU0 or ttyGB0).

2.6. M105 Undocumented USB Requests
------------------------------

The Gigaset M105 USB data box understands a couple of useful, but
undocumented USB commands. These requests are not used in normal
operation (for wireless access to the base), but are needed for access
to the M105's own configuration mode (registration to the base, baudrate
and line format settings, device status queries) via the gigacontr
utility. Their use is controlled by the kernel configuration option
"Support for undocumented USB requests" (CONFIG_GIGASET_UNDOCREQ). If you
encounter error code -ENOTTY when trying to use some features of the
M105, try setting that option to "y" via 'make {x,menu}config' and
recompiling the driver.

2.6. Unregistered Wireless Devices (M101/M105)
-----------------------------------------
The main purpose of the ser_gigaset and usb_gigaset drivers is to allow
the M101 and M105 wireless devices to be used as ISDN devices for ISDN
connections through a Gigaset base. Therefore they assume that the device
is registered to a DECT base.

If the M101/M105 device is not registered to a base, initialization of
the device fails, and a corresponding error message is logged by the
driver. In that situation, a restricted set of functions is available
which includes, in particular, those necessary for registering the device
to a base or for switching it between Fixed Part and Portable Part
modes.

3. Troubleshooting
---------------
Expand Down Expand Up @@ -234,11 +231,12 @@ GigaSet 307x Device Driver
Select Unimodem mode for all DECT data adapters. (see section 2.4.)

Problem:
You want to configure your USB DECT data adapter (M105) but gigacontr
reports an error: "/dev/ttyGU0: Inappropriate ioctl for device".
Messages like this:
usb_gigaset 3-2:1.0: Could not initialize the device.
appear in your syslog.
Solution:
Recompile the usb_gigaset driver with the kernel configuration option
CONFIG_GIGASET_UNDOCREQ set to 'y'. (see section 2.6.)
Check whether your M10x wireless device is correctly registered to the
Gigaset base. (see section 2.6.)

3.2. Telling the driver to provide more information
----------------------------------------------
Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/isdn/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,6 @@ source "drivers/isdn/hardware/Kconfig"

endif # ISDN_CAPI

source "drivers/isdn/gigaset/Kconfig"

endif # ISDN
8 changes: 1 addition & 7 deletions trunk/drivers/isdn/gigaset/Kconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
menuconfig ISDN_DRV_GIGASET
tristate "Siemens Gigaset support"
depends on ISDN_I4L
select CRC_CCITT
select BITREVERSE
help
Expand Down Expand Up @@ -42,11 +43,4 @@ config GIGASET_DEBUG
This enables debugging code in the Gigaset drivers.
If in doubt, say yes.

config GIGASET_UNDOCREQ
bool "Support for undocumented USB requests"
help
This enables support for USB requests we only know from
reverse engineering (currently M105 only). If you need
features like configuration mode of M105, say yes.

endif # ISDN_DRV_GIGASET
5 changes: 2 additions & 3 deletions trunk/drivers/isdn/gigaset/asyncdata.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,8 @@ static inline int hdlc_loop(unsigned char c, unsigned char *src, int numbytes,

if (unlikely(fcs != PPP_GOODFCS)) {
dev_err(cs->dev,
"Packet checksum at %lu failed, "
"packet is corrupted (%u bytes)!\n",
bcs->rcvbytes, skb->len);
"Checksum failed, %u bytes corrupted!\n",
skb->len);
compskb = NULL;
gigaset_rcv_error(compskb, cs, bcs);
error = 1;
Expand Down
12 changes: 2 additions & 10 deletions trunk/drivers/isdn/gigaset/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -565,8 +565,6 @@ static struct bc_state *gigaset_initbcs(struct bc_state *bcs,
gig_dbg(DEBUG_INIT, "setting up bcs[%d]->at_state", channel);
gigaset_at_init(&bcs->at_state, bcs, cs, -1);

bcs->rcvbytes = 0;

#ifdef CONFIG_GIGASET_DEBUG
bcs->emptycount = 0;
#endif
Expand Down Expand Up @@ -672,14 +670,8 @@ struct cardstate *gigaset_initcs(struct gigaset_driver *drv, int channels,
cs->tty = NULL;
cs->tty_dev = NULL;
cs->cidmode = cidmode != 0;

//if(onechannel) { //FIXME
cs->tabnocid = gigaset_tab_nocid_m10x;
cs->tabcid = gigaset_tab_cid_m10x;
//} else {
// cs->tabnocid = gigaset_tab_nocid;
// cs->tabcid = gigaset_tab_cid;
//}
cs->tabnocid = gigaset_tab_nocid;
cs->tabcid = gigaset_tab_cid;

init_waitqueue_head(&cs->waitqueue);
cs->waiting = 0;
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/isdn/gigaset/ev-layer.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@


// 100: init, 200: dle0, 250:dle1, 300: get cid (dial), 350: "hup" (no cid), 400: hup, 500: reset, 600: dial, 700: ring
struct reply_t gigaset_tab_nocid_m10x[]= /* with dle mode */
struct reply_t gigaset_tab_nocid[] =
{
/* resp_code, min_ConState, max_ConState, parameter, new_ConState, timeout, action, command */

Expand Down Expand Up @@ -280,7 +280,7 @@ struct reply_t gigaset_tab_nocid_m10x[]= /* with dle mode */
};

// 600: start dialing, 650: dial in progress, 800: connection is up, 700: ring, 400: hup, 750: accepted icall
struct reply_t gigaset_tab_cid_m10x[] = /* for M10x */
struct reply_t gigaset_tab_cid[] =
{
/* resp_code, min_ConState, max_ConState, parameter, new_ConState, timeout, action, command */

Expand Down
5 changes: 2 additions & 3 deletions trunk/drivers/isdn/gigaset/gigaset.h
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,8 @@ struct reply_t {
char *command; /* NULL==none */
};

extern struct reply_t gigaset_tab_cid_m10x[];
extern struct reply_t gigaset_tab_nocid_m10x[];
extern struct reply_t gigaset_tab_cid[];
extern struct reply_t gigaset_tab_nocid[];

struct inbuf_t {
unsigned char *rcvbuf; /* usb-gigaset receive buffer */
Expand Down Expand Up @@ -384,7 +384,6 @@ struct bc_state {
int trans_up; /* Counter of packages (upstream) */

struct at_state_t at_state;
unsigned long rcvbytes;

__u16 fcs;
struct sk_buff *skb;
Expand Down
12 changes: 7 additions & 5 deletions trunk/drivers/isdn/gigaset/i4l.c
Original file line number Diff line number Diff line change
Expand Up @@ -544,11 +544,11 @@ int gigaset_register_to_LL(struct cardstate *cs, const char *isdnid)

gig_dbg(DEBUG_ANY, "Register driver capabilities to LL");

//iif->id[sizeof(iif->id) - 1]=0;
//strncpy(iif->id, isdnid, sizeof(iif->id) - 1);
if (snprintf(iif->id, sizeof iif->id, "%s_%u", isdnid, cs->minor_index)
>= sizeof iif->id)
return -ENOMEM; //FIXME EINVAL/...??
>= sizeof iif->id) {
pr_err("ID too long: %s\n", isdnid);
return 0;
}

iif->owner = THIS_MODULE;
iif->channels = cs->channels;
Expand All @@ -568,8 +568,10 @@ int gigaset_register_to_LL(struct cardstate *cs, const char *isdnid)
iif->rcvcallb_skb = NULL; /* Will be set by LL */
iif->statcallb = NULL; /* Will be set by LL */

if (!register_isdn(iif))
if (!register_isdn(iif)) {
pr_err("register_isdn failed\n");
return 0;
}

cs->myid = iif->channels; /* Set my device id */
return 1;
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/isdn/gigaset/interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -599,8 +599,7 @@ void gigaset_if_init(struct cardstate *cs)
if (!IS_ERR(cs->tty_dev))
dev_set_drvdata(cs->tty_dev, cs);
else {
dev_warn(cs->dev,
"could not register device to the tty subsystem\n");
pr_warning("could not register device to the tty subsystem\n");
cs->tty_dev = NULL;
}
mutex_unlock(&cs->mutex);
Expand Down
4 changes: 4 additions & 0 deletions trunk/drivers/isdn/gigaset/isocdata.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,10 @@ static inline void dump_bytes(enum debuglevel level, const char *tag,
unsigned char c;
static char dbgline[3 * 32 + 1];
int i = 0;

if (!(gigaset_debuglevel & level))
return;

while (count-- > 0) {
if (i > sizeof(dbgline) - 4) {
dbgline[i] = '\0';
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/isdn/gigaset/proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,5 @@ void gigaset_init_dev_sysfs(struct cardstate *cs)

gig_dbg(DEBUG_INIT, "setting up sysfs");
if (device_create_file(cs->tty_dev, &dev_attr_cidmode))
dev_err(cs->dev, "could not create sysfs attribute\n");
pr_err("could not create sysfs attribute\n");
}
62 changes: 23 additions & 39 deletions trunk/drivers/isdn/gigaset/usb-gigaset.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,6 @@ static inline unsigned tiocm_to_gigaset(unsigned state)
return ((state & TIOCM_DTR) ? 1 : 0) | ((state & TIOCM_RTS) ? 2 : 0);
}

#ifdef CONFIG_GIGASET_UNDOCREQ
/* WARNING: EXPERIMENTAL! */
static int gigaset_set_modem_ctrl(struct cardstate *cs, unsigned old_state,
unsigned new_state)
{
Expand All @@ -176,6 +174,11 @@ static int gigaset_set_modem_ctrl(struct cardstate *cs, unsigned old_state,
return 0;
}

/*
* Set M105 configuration value
* using undocumented device commands reverse engineered from USB traces
* of the Siemens Windows driver
*/
static int set_value(struct cardstate *cs, u8 req, u16 val)
{
struct usb_device *udev = cs->hw.usb->udev;
Expand Down Expand Up @@ -205,8 +208,10 @@ static int set_value(struct cardstate *cs, u8 req, u16 val)
return r < 0 ? r : (r2 < 0 ? r2 : 0);
}

/* WARNING: HIGHLY EXPERIMENTAL! */
// don't use this in an interrupt/BH
/*
* set the baud rate on the internal serial adapter
* using the undocumented parameter setting command
*/
static int gigaset_baud_rate(struct cardstate *cs, unsigned cflag)
{
u16 val;
Expand Down Expand Up @@ -237,8 +242,10 @@ static int gigaset_baud_rate(struct cardstate *cs, unsigned cflag)
return set_value(cs, 1, val);
}

/* WARNING: HIGHLY EXPERIMENTAL! */
// don't use this in an interrupt/BH
/*
* set the line format on the internal serial adapter
* using the undocumented parameter setting command
*/
static int gigaset_set_line_ctrl(struct cardstate *cs, unsigned cflag)
{
u16 val = 0;
Expand Down Expand Up @@ -274,24 +281,6 @@ static int gigaset_set_line_ctrl(struct cardstate *cs, unsigned cflag)
return set_value(cs, 3, val);
}

#else
static int gigaset_set_modem_ctrl(struct cardstate *cs, unsigned old_state,
unsigned new_state)
{
return -ENOTTY;
}

static int gigaset_set_line_ctrl(struct cardstate *cs, unsigned cflag)
{
return -ENOTTY;
}

static int gigaset_baud_rate(struct cardstate *cs, unsigned cflag)
{
return -ENOTTY;
}
#endif


/*================================================================================================================*/
static int gigaset_init_bchannel(struct bc_state *bcs)
Expand Down Expand Up @@ -362,10 +351,8 @@ static void gigaset_modem_fill(unsigned long data)
} while (again);
}

/**
* gigaset_read_int_callback
*
* It is called if the data was received from the device.
/*
* Interrupt Input URB completion routine
*/
static void gigaset_read_int_callback(struct urb *urb)
{
Expand Down Expand Up @@ -567,18 +554,19 @@ static int gigaset_chars_in_buffer(struct cardstate *cs)
return cs->cmdbytes;
}

/*
* set the break characters on the internal serial adapter
* using undocumented device commands reverse engineered from USB traces
* of the Siemens Windows driver
*/
static int gigaset_brkchars(struct cardstate *cs, const unsigned char buf[6])
{
#ifdef CONFIG_GIGASET_UNDOCREQ
struct usb_device *udev = cs->hw.usb->udev;

gigaset_dbg_buffer(DEBUG_USBREQ, "brkchars", 6, buf);
memcpy(cs->hw.usb->bchars, buf, 6);
return usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0x19, 0x41,
0, 0, &buf, 6, 2000);
#else
return -ENOTTY;
#endif
}

static int gigaset_freebcshw(struct bc_state *bcs)
Expand Down Expand Up @@ -625,7 +613,6 @@ static int gigaset_initcshw(struct cardstate *cs)
ucs->bchars[5] = 0x13;
ucs->bulk_out_buffer = NULL;
ucs->bulk_out_urb = NULL;
//ucs->urb_cmd_out = NULL;
ucs->read_urb = NULL;
tasklet_init(&cs->write_tasklet,
&gigaset_modem_fill, (unsigned long) cs);
Expand Down Expand Up @@ -742,7 +729,7 @@ static int gigaset_probe(struct usb_interface *interface,
cs->dev = &interface->dev;

/* save address of controller structure */
usb_set_intfdata(interface, cs); // dev_set_drvdata(&interface->dev, cs);
usb_set_intfdata(interface, cs);

endpoint = &hostif->endpoint[0].desc;

Expand Down Expand Up @@ -921,8 +908,7 @@ static const struct gigaset_ops ops = {
gigaset_m10x_input,
};

/**
* usb_gigaset_init
/*
* This function is called while kernel-module is loaded
*/
static int __init usb_gigaset_init(void)
Expand Down Expand Up @@ -952,9 +938,7 @@ static int __init usb_gigaset_init(void)
return -1;
}


/**
* usb_gigaset_exit
/*
* This function is called while unloading the kernel-module
*/
static void __exit usb_gigaset_exit(void)
Expand Down
2 changes: 0 additions & 2 deletions trunk/drivers/isdn/i4l/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -135,5 +135,3 @@ source "drivers/isdn/act2000/Kconfig"
source "drivers/isdn/hysdn/Kconfig"

endmenu

source "drivers/isdn/gigaset/Kconfig"
14 changes: 7 additions & 7 deletions trunk/drivers/net/82596.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,13 @@ static char version[] __initdata =
#define ISCP_BUSY 0x00010000
#define MACH_IS_APRICOT 0
#else
#define WSWAPrfd(x) ((struct i596_rfd *)(x))
#define WSWAPrbd(x) ((struct i596_rbd *)(x))
#define WSWAPiscp(x) ((struct i596_iscp *)(x))
#define WSWAPscb(x) ((struct i596_scb *)(x))
#define WSWAPcmd(x) ((struct i596_cmd *)(x))
#define WSWAPtbd(x) ((struct i596_tbd *)(x))
#define WSWAPchar(x) ((char *)(x))
#define WSWAPrfd(x) ((struct i596_rfd *)((long)x))
#define WSWAPrbd(x) ((struct i596_rbd *)((long)x))
#define WSWAPiscp(x) ((struct i596_iscp *)((long)x))
#define WSWAPscb(x) ((struct i596_scb *)((long)x))
#define WSWAPcmd(x) ((struct i596_cmd *)((long)x))
#define WSWAPtbd(x) ((struct i596_tbd *)((long)x))
#define WSWAPchar(x) ((char *)((long)x))
#define ISCP_BUSY 0x0001
#define MACH_IS_APRICOT 1
#endif
Expand Down
Loading

0 comments on commit 33f70b3

Please sign in to comment.