diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-02-20 21:58:50 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-02-20 21:58:50 -0500 |
commit | a0b1c42951dd06ec83cc1bc2c9788131d9fefcd8 (patch) | |
tree | a572f1523cf904c93020c9cdb32f3bc84ec3ac16 /drivers/isdn/gigaset | |
parent | 8ec4942212a6d337982967778a3dc3b60aea782e (diff) | |
parent | ecd9883724b78cc72ed92c98bcb1a46c764fff21 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
Pull networking update from David Miller:
1) Checkpoint/restarted TCP sockets now can properly propagate the TCP
timestamp offset. From Andrey Vagin.
2) VMWARE VM VSOCK layer, from Andy King.
3) Much improved support for virtual functions and SR-IOV in bnx2x,
from Ariel ELior.
4) All protocols on ipv4 and ipv6 are now network namespace aware, and
all the compatability checks for initial-namespace-only protocols is
removed. Thanks to Tom Parkin for helping deal with the last major
holdout, L2TP.
5) IPV6 support in netpoll and network namespace support in pktgen,
from Cong Wang.
6) Multiple Registration Protocol (MRP) and Multiple VLAN Registration
Protocol (MVRP) support, from David Ward.
7) Compute packet lengths more accurately in the packet scheduler, from
Eric Dumazet.
8) Use per-task page fragment allocator in skb_append_datato_frags(),
also from Eric Dumazet.
9) Add support for connection tracking labels in netfilter, from
Florian Westphal.
10) Fix default multicast group joining on ipv6, and add anti-spoofing
checks to 6to4 and 6rd. From Hannes Frederic Sowa.
11) Make ipv4/ipv6 fragmentation memory limits more reasonable in modern
times, rearrange inet frag datastructures for better cacheline
locality, and move more operations outside of locking. From Jesper
Dangaard Brouer.
12) Instead of strict master <--> slave relationships, allow arbitrary
scenerios with "upper device lists". From Jiri Pirko.
13) Improve rate limiting accuracy in TBF and act_police, also from Jiri
Pirko.
14) Add a BPF filter netfilter match target, from Willem de Bruijn.
15) Orphan and delete a bunch of pre-historic networking drivers from
Paul Gortmaker.
16) Add TSO support for GRE tunnels, from Pravin B SHelar. Although
this still needs some minor bug fixing before it's %100 correct in
all cases.
17) Handle unresolved IPSEC states like ARP, with a resolution packet
queue. From Steffen Klassert.
18) Remove TCP Appropriate Byte Count support (ABC), from Stephen
Hemminger. This was long overdue.
19) Support SO_REUSEPORT, from Tom Herbert.
20) Allow locking a socket BPF filter, so that it cannot change after a
process drops capabilities.
21) Add VLAN filtering to bridge, from Vlad Yasevich.
22) Bring ipv6 on-par with ipv4 and do not cache neighbour entries in
the ipv6 routes, from YOSHIFUJI Hideaki.
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1538 commits)
ipv6: fix race condition regarding dst->expires and dst->from.
net: fix a wrong assignment in skb_split()
ip_gre: remove an extra dst_release()
ppp: set qdisc_tx_busylock to avoid LOCKDEP splat
atl1c: restore buffer state
net: fix a build failure when !CONFIG_PROC_FS
net: ipv4: fix waring -Wunused-variable
net: proc: fix build failed when procfs is not configured
Revert "xen: netback: remove redundant xenvif_put"
net: move procfs code to net/core/net-procfs.c
qmi_wwan, cdc-ether: add ADU960S
bonding: set sysfs device_type to 'bond'
bonding: fix bond_release_all inconsistencies
b44: use netdev_alloc_skb_ip_align()
xen: netback: remove redundant xenvif_put
net: fec: Do a sanity check on the gpio number
ip_gre: propogate target device GSO capability to the tunnel device
ip_gre: allow CSUM capable devices to handle packets
bonding: Fix initialize after use for 3ad machine state spinlock
bonding: Fix race condition between bond_enslave() and bond_3ad_update_lacp_rate()
...
Diffstat (limited to 'drivers/isdn/gigaset')
-rw-r--r-- | drivers/isdn/gigaset/common.c | 31 | ||||
-rw-r--r-- | drivers/isdn/gigaset/ev-layer.c | 124 | ||||
-rw-r--r-- | drivers/isdn/gigaset/gigaset.h | 9 | ||||
-rw-r--r-- | drivers/isdn/gigaset/interface.c | 46 |
4 files changed, 93 insertions, 117 deletions
diff --git a/drivers/isdn/gigaset/common.c b/drivers/isdn/gigaset/common.c index 6849a11a1b24..7c7814497e3e 100644 --- a/drivers/isdn/gigaset/common.c +++ b/drivers/isdn/gigaset/common.c | |||
@@ -467,11 +467,6 @@ void gigaset_freecs(struct cardstate *cs) | |||
467 | 467 | ||
468 | mutex_lock(&cs->mutex); | 468 | mutex_lock(&cs->mutex); |
469 | 469 | ||
470 | if (!cs->bcs) | ||
471 | goto f_cs; | ||
472 | if (!cs->inbuf) | ||
473 | goto f_bcs; | ||
474 | |||
475 | spin_lock_irqsave(&cs->lock, flags); | 470 | spin_lock_irqsave(&cs->lock, flags); |
476 | cs->running = 0; | 471 | cs->running = 0; |
477 | spin_unlock_irqrestore(&cs->lock, flags); /* event handler and timer are | 472 | spin_unlock_irqrestore(&cs->lock, flags); /* event handler and timer are |
@@ -507,17 +502,16 @@ void gigaset_freecs(struct cardstate *cs) | |||
507 | gig_dbg(DEBUG_INIT, "clearing at_state"); | 502 | gig_dbg(DEBUG_INIT, "clearing at_state"); |
508 | clear_at_state(&cs->at_state); | 503 | clear_at_state(&cs->at_state); |
509 | dealloc_temp_at_states(cs); | 504 | dealloc_temp_at_states(cs); |
505 | clear_events(cs); | ||
510 | tty_port_destroy(&cs->port); | 506 | tty_port_destroy(&cs->port); |
511 | 507 | ||
512 | /* fall through */ | 508 | /* fall through */ |
513 | case 0: /* error in basic setup */ | 509 | case 0: /* error in basic setup */ |
514 | clear_events(cs); | ||
515 | gig_dbg(DEBUG_INIT, "freeing inbuf"); | 510 | gig_dbg(DEBUG_INIT, "freeing inbuf"); |
516 | kfree(cs->inbuf); | 511 | kfree(cs->inbuf); |
512 | kfree(cs->bcs); | ||
517 | } | 513 | } |
518 | f_bcs: gig_dbg(DEBUG_INIT, "freeing bcs[]"); | 514 | |
519 | kfree(cs->bcs); | ||
520 | f_cs: gig_dbg(DEBUG_INIT, "freeing cs"); | ||
521 | mutex_unlock(&cs->mutex); | 515 | mutex_unlock(&cs->mutex); |
522 | free_cs(cs); | 516 | free_cs(cs); |
523 | } | 517 | } |
@@ -687,19 +681,6 @@ struct cardstate *gigaset_initcs(struct gigaset_driver *drv, int channels, | |||
687 | return NULL; | 681 | return NULL; |
688 | } | 682 | } |
689 | 683 | ||
690 | gig_dbg(DEBUG_INIT, "allocating bcs[0..%d]", channels - 1); | ||
691 | cs->bcs = kmalloc(channels * sizeof(struct bc_state), GFP_KERNEL); | ||
692 | if (!cs->bcs) { | ||
693 | pr_err("out of memory\n"); | ||
694 | goto error; | ||
695 | } | ||
696 | gig_dbg(DEBUG_INIT, "allocating inbuf"); | ||
697 | cs->inbuf = kmalloc(sizeof(struct inbuf_t), GFP_KERNEL); | ||
698 | if (!cs->inbuf) { | ||
699 | pr_err("out of memory\n"); | ||
700 | goto error; | ||
701 | } | ||
702 | |||
703 | cs->cs_init = 0; | 684 | cs->cs_init = 0; |
704 | cs->channels = channels; | 685 | cs->channels = channels; |
705 | cs->onechannel = onechannel; | 686 | cs->onechannel = onechannel; |
@@ -729,6 +710,12 @@ struct cardstate *gigaset_initcs(struct gigaset_driver *drv, int channels, | |||
729 | cs->mode = M_UNKNOWN; | 710 | cs->mode = M_UNKNOWN; |
730 | cs->mstate = MS_UNINITIALIZED; | 711 | cs->mstate = MS_UNINITIALIZED; |
731 | 712 | ||
713 | cs->bcs = kmalloc(channels * sizeof(struct bc_state), GFP_KERNEL); | ||
714 | cs->inbuf = kmalloc(sizeof(struct inbuf_t), GFP_KERNEL); | ||
715 | if (!cs->bcs || !cs->inbuf) { | ||
716 | pr_err("out of memory\n"); | ||
717 | goto error; | ||
718 | } | ||
732 | ++cs->cs_init; | 719 | ++cs->cs_init; |
733 | 720 | ||
734 | gig_dbg(DEBUG_INIT, "setting up at_state"); | 721 | gig_dbg(DEBUG_INIT, "setting up at_state"); |
diff --git a/drivers/isdn/gigaset/ev-layer.c b/drivers/isdn/gigaset/ev-layer.c index 2e6963dc740e..7459b127ddd5 100644 --- a/drivers/isdn/gigaset/ev-layer.c +++ b/drivers/isdn/gigaset/ev-layer.c | |||
@@ -351,10 +351,11 @@ struct reply_t gigaset_tab_cid[] = | |||
351 | 351 | ||
352 | 352 | ||
353 | static const struct resp_type_t { | 353 | static const struct resp_type_t { |
354 | unsigned char *response; | 354 | char *response; |
355 | int resp_code; | 355 | int resp_code; |
356 | int type; | 356 | int type; |
357 | } resp_type[] = | 357 | } |
358 | resp_type[] = | ||
358 | { | 359 | { |
359 | {"OK", RSP_OK, RT_NOTHING}, | 360 | {"OK", RSP_OK, RT_NOTHING}, |
360 | {"ERROR", RSP_ERROR, RT_NOTHING}, | 361 | {"ERROR", RSP_ERROR, RT_NOTHING}, |
@@ -374,11 +375,12 @@ static const struct resp_type_t { | |||
374 | }; | 375 | }; |
375 | 376 | ||
376 | static const struct zsau_resp_t { | 377 | static const struct zsau_resp_t { |
377 | unsigned char *str; | 378 | char *str; |
378 | int code; | 379 | int code; |
379 | } zsau_resp[] = | 380 | } |
381 | zsau_resp[] = | ||
380 | { | 382 | { |
381 | {"OUTGOING_CALL_PROCEEDING", ZSAU_OUTGOING_CALL_PROCEEDING}, | 383 | {"OUTGOING_CALL_PROCEEDING", ZSAU_PROCEEDING}, |
382 | {"CALL_DELIVERED", ZSAU_CALL_DELIVERED}, | 384 | {"CALL_DELIVERED", ZSAU_CALL_DELIVERED}, |
383 | {"ACTIVE", ZSAU_ACTIVE}, | 385 | {"ACTIVE", ZSAU_ACTIVE}, |
384 | {"DISCONNECT_IND", ZSAU_DISCONNECT_IND}, | 386 | {"DISCONNECT_IND", ZSAU_DISCONNECT_IND}, |
@@ -434,7 +436,7 @@ void gigaset_handle_modem_response(struct cardstate *cs) | |||
434 | len = cs->cbytes; | 436 | len = cs->cbytes; |
435 | if (!len) { | 437 | if (!len) { |
436 | /* ignore additional LFs/CRs (M10x config mode or cx100) */ | 438 | /* ignore additional LFs/CRs (M10x config mode or cx100) */ |
437 | gig_dbg(DEBUG_MCMD, "skipped EOL [%02X]", cs->respdata[len]); | 439 | gig_dbg(DEBUG_MCMD, "skipped EOL [%02X]", cs->respdata[0]); |
438 | return; | 440 | return; |
439 | } | 441 | } |
440 | cs->respdata[len] = 0; | 442 | cs->respdata[len] = 0; |
@@ -707,27 +709,29 @@ static void schedule_init(struct cardstate *cs, int state) | |||
707 | cs->commands_pending = 1; | 709 | cs->commands_pending = 1; |
708 | } | 710 | } |
709 | 711 | ||
710 | /* Add "AT" to a command, add the cid, dle encode it, send the result to the | 712 | /* send an AT command |
711 | hardware. */ | 713 | * adding the "AT" prefix, cid and DLE encapsulation as appropriate |
712 | static void send_command(struct cardstate *cs, const char *cmd, int cid, | 714 | */ |
713 | int dle, gfp_t kmallocflags) | 715 | static void send_command(struct cardstate *cs, const char *cmd, |
716 | struct at_state_t *at_state) | ||
714 | { | 717 | { |
718 | int cid = at_state->cid; | ||
715 | struct cmdbuf_t *cb; | 719 | struct cmdbuf_t *cb; |
716 | size_t buflen; | 720 | size_t buflen; |
717 | 721 | ||
718 | buflen = strlen(cmd) + 12; /* DLE ( A T 1 2 3 4 5 <cmd> DLE ) \0 */ | 722 | buflen = strlen(cmd) + 12; /* DLE ( A T 1 2 3 4 5 <cmd> DLE ) \0 */ |
719 | cb = kmalloc(sizeof(struct cmdbuf_t) + buflen, kmallocflags); | 723 | cb = kmalloc(sizeof(struct cmdbuf_t) + buflen, GFP_ATOMIC); |
720 | if (!cb) { | 724 | if (!cb) { |
721 | dev_err(cs->dev, "%s: out of memory\n", __func__); | 725 | dev_err(cs->dev, "%s: out of memory\n", __func__); |
722 | return; | 726 | return; |
723 | } | 727 | } |
724 | if (cid > 0 && cid <= 65535) | 728 | if (cid > 0 && cid <= 65535) |
725 | cb->len = snprintf(cb->buf, buflen, | 729 | cb->len = snprintf(cb->buf, buflen, |
726 | dle ? "\020(AT%d%s\020)" : "AT%d%s", | 730 | cs->dle ? "\020(AT%d%s\020)" : "AT%d%s", |
727 | cid, cmd); | 731 | cid, cmd); |
728 | else | 732 | else |
729 | cb->len = snprintf(cb->buf, buflen, | 733 | cb->len = snprintf(cb->buf, buflen, |
730 | dle ? "\020(AT%s\020)" : "AT%s", | 734 | cs->dle ? "\020(AT%s\020)" : "AT%s", |
731 | cmd); | 735 | cmd); |
732 | cb->offset = 0; | 736 | cb->offset = 0; |
733 | cb->next = NULL; | 737 | cb->next = NULL; |
@@ -886,7 +890,7 @@ static void finish_shutdown(struct cardstate *cs) | |||
886 | gigaset_isdn_stop(cs); | 890 | gigaset_isdn_stop(cs); |
887 | } | 891 | } |
888 | 892 | ||
889 | /* The rest is done by cleanup_cs () in user mode. */ | 893 | /* The rest is done by cleanup_cs() in process context. */ |
890 | 894 | ||
891 | cs->cmd_result = -ENODEV; | 895 | cs->cmd_result = -ENODEV; |
892 | cs->waiting = 0; | 896 | cs->waiting = 0; |
@@ -976,10 +980,9 @@ exit: | |||
976 | } | 980 | } |
977 | 981 | ||
978 | static void handle_icall(struct cardstate *cs, struct bc_state *bcs, | 982 | static void handle_icall(struct cardstate *cs, struct bc_state *bcs, |
979 | struct at_state_t **p_at_state) | 983 | struct at_state_t *at_state) |
980 | { | 984 | { |
981 | int retval; | 985 | int retval; |
982 | struct at_state_t *at_state = *p_at_state; | ||
983 | 986 | ||
984 | retval = gigaset_isdn_icall(at_state); | 987 | retval = gigaset_isdn_icall(at_state); |
985 | switch (retval) { | 988 | switch (retval) { |
@@ -1176,7 +1179,7 @@ static void do_action(int action, struct cardstate *cs, | |||
1176 | spin_unlock_irqrestore(&cs->lock, flags); | 1179 | spin_unlock_irqrestore(&cs->lock, flags); |
1177 | break; | 1180 | break; |
1178 | case ACT_ICALL: | 1181 | case ACT_ICALL: |
1179 | handle_icall(cs, bcs, p_at_state); | 1182 | handle_icall(cs, bcs, at_state); |
1180 | break; | 1183 | break; |
1181 | case ACT_FAILSDOWN: | 1184 | case ACT_FAILSDOWN: |
1182 | dev_warn(cs->dev, "Could not shut down the device.\n"); | 1185 | dev_warn(cs->dev, "Could not shut down the device.\n"); |
@@ -1264,7 +1267,7 @@ static void do_action(int action, struct cardstate *cs, | |||
1264 | cs->commands_pending = 1; | 1267 | cs->commands_pending = 1; |
1265 | break; | 1268 | break; |
1266 | } | 1269 | } |
1267 | /* fall through */ | 1270 | /* bad cid: fall through */ |
1268 | case ACT_FAILCID: | 1271 | case ACT_FAILCID: |
1269 | cs->cur_at_seq = SEQ_NONE; | 1272 | cs->cur_at_seq = SEQ_NONE; |
1270 | channel = cs->curchannel; | 1273 | channel = cs->curchannel; |
@@ -1339,7 +1342,6 @@ static void do_action(int action, struct cardstate *cs, | |||
1339 | *p_resp_code = RSP_ERROR; | 1342 | *p_resp_code = RSP_ERROR; |
1340 | break; | 1343 | break; |
1341 | } | 1344 | } |
1342 | /*at_state->getstring = 1;*/ | ||
1343 | cs->gotfwver = 0; | 1345 | cs->gotfwver = 0; |
1344 | break; | 1346 | break; |
1345 | case ACT_GOTVER: | 1347 | case ACT_GOTVER: |
@@ -1471,7 +1473,6 @@ static void process_event(struct cardstate *cs, struct event_t *ev) | |||
1471 | int rcode; | 1473 | int rcode; |
1472 | int genresp = 0; | 1474 | int genresp = 0; |
1473 | int resp_code = RSP_ERROR; | 1475 | int resp_code = RSP_ERROR; |
1474 | int sendcid; | ||
1475 | struct at_state_t *at_state; | 1476 | struct at_state_t *at_state; |
1476 | int index; | 1477 | int index; |
1477 | int curact; | 1478 | int curact; |
@@ -1499,7 +1500,6 @@ static void process_event(struct cardstate *cs, struct event_t *ev) | |||
1499 | at_state->ConState, ev->type); | 1500 | at_state->ConState, ev->type); |
1500 | 1501 | ||
1501 | bcs = at_state->bcs; | 1502 | bcs = at_state->bcs; |
1502 | sendcid = at_state->cid; | ||
1503 | 1503 | ||
1504 | /* Setting the pointer to the dial array */ | 1504 | /* Setting the pointer to the dial array */ |
1505 | rep = at_state->replystruct; | 1505 | rep = at_state->replystruct; |
@@ -1510,10 +1510,12 @@ static void process_event(struct cardstate *cs, struct event_t *ev) | |||
1510 | || !at_state->timer_active) { | 1510 | || !at_state->timer_active) { |
1511 | ev->type = RSP_NONE; /* old timeout */ | 1511 | ev->type = RSP_NONE; /* old timeout */ |
1512 | gig_dbg(DEBUG_EVENT, "old timeout"); | 1512 | gig_dbg(DEBUG_EVENT, "old timeout"); |
1513 | } else if (!at_state->waiting) | 1513 | } else { |
1514 | gig_dbg(DEBUG_EVENT, "timeout occurred"); | 1514 | if (at_state->waiting) |
1515 | else | 1515 | gig_dbg(DEBUG_EVENT, "stopped waiting"); |
1516 | gig_dbg(DEBUG_EVENT, "stopped waiting"); | 1516 | else |
1517 | gig_dbg(DEBUG_EVENT, "timeout occurred"); | ||
1518 | } | ||
1517 | } | 1519 | } |
1518 | spin_unlock_irqrestore(&cs->lock, flags); | 1520 | spin_unlock_irqrestore(&cs->lock, flags); |
1519 | 1521 | ||
@@ -1561,45 +1563,40 @@ static void process_event(struct cardstate *cs, struct event_t *ev) | |||
1561 | do_action(rep->action[curact], cs, bcs, &at_state, &p_command, | 1563 | do_action(rep->action[curact], cs, bcs, &at_state, &p_command, |
1562 | &genresp, &resp_code, ev); | 1564 | &genresp, &resp_code, ev); |
1563 | if (!at_state) | 1565 | if (!at_state) |
1564 | break; /* may be freed after disconnect */ | 1566 | /* at_state destroyed by disconnect */ |
1567 | return; | ||
1565 | } | 1568 | } |
1566 | 1569 | ||
1567 | if (at_state) { | 1570 | /* Jump to the next con-state regarding the array */ |
1568 | /* Jump to the next con-state regarding the array */ | 1571 | if (rep->new_ConState >= 0) |
1569 | if (rep->new_ConState >= 0) | 1572 | at_state->ConState = rep->new_ConState; |
1570 | at_state->ConState = rep->new_ConState; | ||
1571 | 1573 | ||
1572 | if (genresp) { | 1574 | if (genresp) { |
1573 | spin_lock_irqsave(&cs->lock, flags); | 1575 | spin_lock_irqsave(&cs->lock, flags); |
1576 | at_state->timer_expires = 0; | ||
1577 | at_state->timer_active = 0; | ||
1578 | spin_unlock_irqrestore(&cs->lock, flags); | ||
1579 | gigaset_add_event(cs, at_state, resp_code, NULL, 0, NULL); | ||
1580 | } else { | ||
1581 | /* Send command to modem if not NULL... */ | ||
1582 | if (p_command) { | ||
1583 | if (cs->connected) | ||
1584 | send_command(cs, p_command, at_state); | ||
1585 | else | ||
1586 | gigaset_add_event(cs, at_state, RSP_NODEV, | ||
1587 | NULL, 0, NULL); | ||
1588 | } | ||
1589 | |||
1590 | spin_lock_irqsave(&cs->lock, flags); | ||
1591 | if (!rep->timeout) { | ||
1574 | at_state->timer_expires = 0; | 1592 | at_state->timer_expires = 0; |
1575 | at_state->timer_active = 0; | 1593 | at_state->timer_active = 0; |
1576 | spin_unlock_irqrestore(&cs->lock, flags); | 1594 | } else if (rep->timeout > 0) { /* new timeout */ |
1577 | gigaset_add_event(cs, at_state, resp_code, | 1595 | at_state->timer_expires = rep->timeout * 10; |
1578 | NULL, 0, NULL); | 1596 | at_state->timer_active = 1; |
1579 | } else { | 1597 | ++at_state->timer_index; |
1580 | /* Send command to modem if not NULL... */ | ||
1581 | if (p_command) { | ||
1582 | if (cs->connected) | ||
1583 | send_command(cs, p_command, | ||
1584 | sendcid, cs->dle, | ||
1585 | GFP_ATOMIC); | ||
1586 | else | ||
1587 | gigaset_add_event(cs, at_state, | ||
1588 | RSP_NODEV, | ||
1589 | NULL, 0, NULL); | ||
1590 | } | ||
1591 | |||
1592 | spin_lock_irqsave(&cs->lock, flags); | ||
1593 | if (!rep->timeout) { | ||
1594 | at_state->timer_expires = 0; | ||
1595 | at_state->timer_active = 0; | ||
1596 | } else if (rep->timeout > 0) { /* new timeout */ | ||
1597 | at_state->timer_expires = rep->timeout * 10; | ||
1598 | at_state->timer_active = 1; | ||
1599 | ++at_state->timer_index; | ||
1600 | } | ||
1601 | spin_unlock_irqrestore(&cs->lock, flags); | ||
1602 | } | 1598 | } |
1599 | spin_unlock_irqrestore(&cs->lock, flags); | ||
1603 | } | 1600 | } |
1604 | } | 1601 | } |
1605 | 1602 | ||
@@ -1693,6 +1690,11 @@ static void process_command_flags(struct cardstate *cs) | |||
1693 | for (i = 0; i < cs->channels; ++i) { | 1690 | for (i = 0; i < cs->channels; ++i) { |
1694 | bcs = cs->bcs + i; | 1691 | bcs = cs->bcs + i; |
1695 | if (bcs->at_state.pending_commands & PC_HUP) { | 1692 | if (bcs->at_state.pending_commands & PC_HUP) { |
1693 | if (cs->dle) { | ||
1694 | cs->curchannel = bcs->channel; | ||
1695 | schedule_sequence(cs, &cs->at_state, SEQ_DLE0); | ||
1696 | return; | ||
1697 | } | ||
1696 | bcs->at_state.pending_commands &= ~PC_HUP; | 1698 | bcs->at_state.pending_commands &= ~PC_HUP; |
1697 | if (bcs->at_state.pending_commands & PC_CID) { | 1699 | if (bcs->at_state.pending_commands & PC_CID) { |
1698 | /* not yet dialing: PC_NOCID is sufficient */ | 1700 | /* not yet dialing: PC_NOCID is sufficient */ |
diff --git a/drivers/isdn/gigaset/gigaset.h b/drivers/isdn/gigaset/gigaset.h index 8e2fc8f31d16..eb63a0f7a02a 100644 --- a/drivers/isdn/gigaset/gigaset.h +++ b/drivers/isdn/gigaset/gigaset.h | |||
@@ -111,11 +111,10 @@ void gigaset_dbg_buffer(enum debuglevel level, const unsigned char *msg, | |||
111 | 111 | ||
112 | /* connection state */ | 112 | /* connection state */ |
113 | #define ZSAU_NONE 0 | 113 | #define ZSAU_NONE 0 |
114 | #define ZSAU_DISCONNECT_IND 4 | ||
115 | #define ZSAU_OUTGOING_CALL_PROCEEDING 1 | ||
116 | #define ZSAU_PROCEEDING 1 | 114 | #define ZSAU_PROCEEDING 1 |
117 | #define ZSAU_CALL_DELIVERED 2 | 115 | #define ZSAU_CALL_DELIVERED 2 |
118 | #define ZSAU_ACTIVE 3 | 116 | #define ZSAU_ACTIVE 3 |
117 | #define ZSAU_DISCONNECT_IND 4 | ||
119 | #define ZSAU_NULL 5 | 118 | #define ZSAU_NULL 5 |
120 | #define ZSAU_DISCONNECT_REQ 6 | 119 | #define ZSAU_DISCONNECT_REQ 6 |
121 | #define ZSAU_UNKNOWN -1 | 120 | #define ZSAU_UNKNOWN -1 |
@@ -183,18 +182,22 @@ void gigaset_dbg_buffer(enum debuglevel level, const unsigned char *msg, | |||
183 | #define AT_NUM 7 | 182 | #define AT_NUM 7 |
184 | 183 | ||
185 | /* variables in struct at_state_t */ | 184 | /* variables in struct at_state_t */ |
185 | /* - numeric */ | ||
186 | #define VAR_ZSAU 0 | 186 | #define VAR_ZSAU 0 |
187 | #define VAR_ZDLE 1 | 187 | #define VAR_ZDLE 1 |
188 | #define VAR_ZCTP 2 | 188 | #define VAR_ZCTP 2 |
189 | /* total number */ | ||
189 | #define VAR_NUM 3 | 190 | #define VAR_NUM 3 |
190 | 191 | /* - string */ | |
191 | #define STR_NMBR 0 | 192 | #define STR_NMBR 0 |
192 | #define STR_ZCPN 1 | 193 | #define STR_ZCPN 1 |
193 | #define STR_ZCON 2 | 194 | #define STR_ZCON 2 |
194 | #define STR_ZBC 3 | 195 | #define STR_ZBC 3 |
195 | #define STR_ZHLC 4 | 196 | #define STR_ZHLC 4 |
197 | /* total number */ | ||
196 | #define STR_NUM 5 | 198 | #define STR_NUM 5 |
197 | 199 | ||
200 | /* event types */ | ||
198 | #define EV_TIMEOUT -105 | 201 | #define EV_TIMEOUT -105 |
199 | #define EV_IF_VER -106 | 202 | #define EV_IF_VER -106 |
200 | #define EV_PROC_CIDMODE -107 | 203 | #define EV_PROC_CIDMODE -107 |
diff --git a/drivers/isdn/gigaset/interface.c b/drivers/isdn/gigaset/interface.c index 67abf3ff45e8..20b7e7a1190f 100644 --- a/drivers/isdn/gigaset/interface.c +++ b/drivers/isdn/gigaset/interface.c | |||
@@ -112,36 +112,6 @@ static int if_config(struct cardstate *cs, int *arg) | |||
112 | } | 112 | } |
113 | 113 | ||
114 | /*** the terminal driver ***/ | 114 | /*** the terminal driver ***/ |
115 | /* stolen from usbserial and some other tty drivers */ | ||
116 | |||
117 | static int if_open(struct tty_struct *tty, struct file *filp); | ||
118 | static void if_close(struct tty_struct *tty, struct file *filp); | ||
119 | static int if_ioctl(struct tty_struct *tty, | ||
120 | unsigned int cmd, unsigned long arg); | ||
121 | static int if_write_room(struct tty_struct *tty); | ||
122 | static int if_chars_in_buffer(struct tty_struct *tty); | ||
123 | static void if_throttle(struct tty_struct *tty); | ||
124 | static void if_unthrottle(struct tty_struct *tty); | ||
125 | static void if_set_termios(struct tty_struct *tty, struct ktermios *old); | ||
126 | static int if_tiocmget(struct tty_struct *tty); | ||
127 | static int if_tiocmset(struct tty_struct *tty, | ||
128 | unsigned int set, unsigned int clear); | ||
129 | static int if_write(struct tty_struct *tty, | ||
130 | const unsigned char *buf, int count); | ||
131 | |||
132 | static const struct tty_operations if_ops = { | ||
133 | .open = if_open, | ||
134 | .close = if_close, | ||
135 | .ioctl = if_ioctl, | ||
136 | .write = if_write, | ||
137 | .write_room = if_write_room, | ||
138 | .chars_in_buffer = if_chars_in_buffer, | ||
139 | .set_termios = if_set_termios, | ||
140 | .throttle = if_throttle, | ||
141 | .unthrottle = if_unthrottle, | ||
142 | .tiocmget = if_tiocmget, | ||
143 | .tiocmset = if_tiocmset, | ||
144 | }; | ||
145 | 115 | ||
146 | static int if_open(struct tty_struct *tty, struct file *filp) | 116 | static int if_open(struct tty_struct *tty, struct file *filp) |
147 | { | 117 | { |
@@ -355,7 +325,7 @@ done: | |||
355 | static int if_write_room(struct tty_struct *tty) | 325 | static int if_write_room(struct tty_struct *tty) |
356 | { | 326 | { |
357 | struct cardstate *cs = tty->driver_data; | 327 | struct cardstate *cs = tty->driver_data; |
358 | int retval = -ENODEV; | 328 | int retval; |
359 | 329 | ||
360 | gig_dbg(DEBUG_IF, "%u: %s()", cs->minor_index, __func__); | 330 | gig_dbg(DEBUG_IF, "%u: %s()", cs->minor_index, __func__); |
361 | 331 | ||
@@ -498,6 +468,20 @@ out: | |||
498 | mutex_unlock(&cs->mutex); | 468 | mutex_unlock(&cs->mutex); |
499 | } | 469 | } |
500 | 470 | ||
471 | static const struct tty_operations if_ops = { | ||
472 | .open = if_open, | ||
473 | .close = if_close, | ||
474 | .ioctl = if_ioctl, | ||
475 | .write = if_write, | ||
476 | .write_room = if_write_room, | ||
477 | .chars_in_buffer = if_chars_in_buffer, | ||
478 | .set_termios = if_set_termios, | ||
479 | .throttle = if_throttle, | ||
480 | .unthrottle = if_unthrottle, | ||
481 | .tiocmget = if_tiocmget, | ||
482 | .tiocmset = if_tiocmset, | ||
483 | }; | ||
484 | |||
501 | 485 | ||
502 | /* wakeup tasklet for the write operation */ | 486 | /* wakeup tasklet for the write operation */ |
503 | static void if_wake(unsigned long data) | 487 | static void if_wake(unsigned long data) |