Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 254139
b: refs/heads/master
c: 7263287
h: refs/heads/master
i:
  254137: 279fd96
  254135: f92e3d8
v: v3
  • Loading branch information
Russ Gorby authored and Greg Kroah-Hartman committed Jun 16, 2011
1 parent 1ea948e commit 27446f3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 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: 2872628680bad71a6734e7d379168f990a91cc09
refs/heads/master: 7263287af93db4d5cf324a30546f2143419b7900
23 changes: 18 additions & 5 deletions trunk/drivers/tty/n_gsm.c
Original file line number Diff line number Diff line change
Expand Up @@ -984,10 +984,22 @@ static void gsm_control_reply(struct gsm_mux *gsm, int cmd, u8 *data,
*/

static void gsm_process_modem(struct tty_struct *tty, struct gsm_dlci *dlci,
u32 modem)
u32 modem, int clen)
{
int mlines = 0;
u8 brk = modem >> 6;
u8 brk = 0;

/* The modem status command can either contain one octet (v.24 signals)
or two octets (v.24 signals + break signals). The length field will
either be 2 or 3 respectively. This is specified in section
5.4.6.3.7 of the 27.010 mux spec. */

if (clen == 2)
modem = modem & 0x7f;
else {
brk = modem & 0x7f;
modem = (modem >> 7) & 0x7f;
};

/* Flow control/ready to communicate */
if (modem & MDM_FC) {
Expand Down Expand Up @@ -1061,7 +1073,7 @@ static void gsm_control_modem(struct gsm_mux *gsm, u8 *data, int clen)
return;
}
tty = tty_port_tty_get(&dlci->port);
gsm_process_modem(tty, dlci, modem);
gsm_process_modem(tty, dlci, modem, clen);
if (tty) {
tty_wakeup(tty);
tty_kref_put(tty);
Expand Down Expand Up @@ -1482,12 +1494,13 @@ static void gsm_dlci_begin_close(struct gsm_dlci *dlci)
* open we shovel the bits down it, if not we drop them.
*/

static void gsm_dlci_data(struct gsm_dlci *dlci, u8 *data, int len)
static void gsm_dlci_data(struct gsm_dlci *dlci, u8 *data, int clen)
{
/* krefs .. */
struct tty_port *port = &dlci->port;
struct tty_struct *tty = tty_port_tty_get(port);
unsigned int modem = 0;
int len = clen;

if (debug & 16)
pr_debug("%d bytes for tty %p\n", len, tty);
Expand All @@ -1507,7 +1520,7 @@ static void gsm_dlci_data(struct gsm_dlci *dlci, u8 *data, int len)
if (len == 0)
return;
}
gsm_process_modem(tty, dlci, modem);
gsm_process_modem(tty, dlci, modem, clen);
/* Line state will go via DLCI 0 controls only */
case 1:
default:
Expand Down

0 comments on commit 27446f3

Please sign in to comment.