Lines Matching defs:gsm

128 	struct gsm_mux *gsm;
196 * to the gsm mux array. For now we don't free DLCI objects that
228 void (*receive)(struct gsm_mux *gsm, u8 ch);
371 static int gsmld_output(struct gsm_mux *gsm, u8 *data, int len);
463 if (dlci->modem_tx & TIOCM_CD || dlci->gsm->initiator)
632 * @gsm: our GSM mux
644 static void gsm_send(struct gsm_mux *gsm, int addr, int cr, int control)
650 switch (gsm->encoding) {
678 gsmld_output(gsm, cbuf, len);
684 * @gsm: our GSM mux
691 static inline void gsm_response(struct gsm_mux *gsm, int addr, int control)
693 gsm_send(gsm, addr, 0, control);
698 * @gsm: our GSM mux
705 static inline void gsm_command(struct gsm_mux *gsm, int addr, int control)
707 gsm_send(gsm, addr, 1, control);
716 * @gsm: GSM mux
726 static struct gsm_msg *gsm_data_alloc(struct gsm_mux *gsm, u8 addr, int len,
774 * @gsm: GSM Mux
784 static void gsm_data_kick(struct gsm_mux *gsm, struct gsm_dlci *dlci)
789 list_for_each_entry_safe(msg, nmsg, &gsm->tx_list, list) {
790 if (gsm->constipated && !gsm_is_flow_ctrl_msg(msg))
792 if (gsm->encoding != 0) {
793 gsm->txframe[0] = GSM1_SOF;
795 gsm->txframe + 1, msg->len);
796 gsm->txframe[len + 1] = GSM1_SOF;
799 gsm->txframe[0] = GSM0_SOF;
800 memcpy(gsm->txframe + 1 , msg->data, msg->len);
801 gsm->txframe[msg->len + 1] = GSM0_SOF;
808 gsm->txframe, len);
809 if (gsmld_output(gsm, gsm->txframe, len) < 0)
812 gsm->tx_bytes -= msg->len;
823 if (gsm->dlci[i])
824 tty_port_tty_wakeup(&gsm->dlci[i]->port);
836 * the gsm tx lock.
841 struct gsm_mux *gsm = dlci->gsm;
846 if (gsm->encoding == 0) {
856 if (gsm->initiator)
866 gsm_print_packet("Q> ", msg->addr, gsm->initiator, msg->ctrl,
875 list_add_tail(&msg->list, &gsm->tx_list);
876 gsm->tx_bytes += msg->len;
877 gsm_data_kick(gsm, dlci);
887 * the gsm tx lock and dlci lock.
893 spin_lock_irqsave(&dlci->gsm->tx_lock, flags);
895 spin_unlock_irqrestore(&dlci->gsm->tx_lock, flags);
900 * @gsm: mux
910 static int gsm_dlci_data_output(struct gsm_mux *gsm, struct gsm_dlci *dlci)
924 if ((len + h) > gsm->mtu)
925 len = gsm->mtu - h;
929 msg = gsm_data_alloc(gsm, dlci->addr, size, gsm->ftype);
963 * @gsm: mux
973 static int gsm_dlci_data_output_framed(struct gsm_mux *gsm,
996 if (len > gsm->mtu) {
1003 len = gsm->mtu;
1008 msg = gsm_data_alloc(gsm, dlci->addr, size, gsm->ftype);
1036 * @gsm: the GSM mux
1047 static void gsm_dlci_data_sweep(struct gsm_mux *gsm)
1056 if (gsm->tx_bytes > TX_THRESH_HI)
1058 dlci = gsm->dlci[i];
1064 len = gsm_dlci_data_output(gsm, dlci);
1066 len = gsm_dlci_data_output_framed(gsm, dlci);
1092 spin_lock_irqsave(&dlci->gsm->tx_lock, flags);
1094 sweep = (dlci->gsm->tx_bytes < TX_THRESH_LO);
1095 if (dlci->gsm->tx_bytes == 0) {
1097 gsm_dlci_data_output_framed(dlci->gsm, dlci);
1099 gsm_dlci_data_output(dlci->gsm, dlci);
1102 gsm_dlci_data_sweep(dlci->gsm);
1103 spin_unlock_irqrestore(&dlci->gsm->tx_lock, flags);
1113 * @gsm: gsm channel
1121 static void gsm_control_reply(struct gsm_mux *gsm, int cmd, const u8 *data,
1125 msg = gsm_data_alloc(gsm, 0, dlen + 2, gsm->ftype);
1131 gsm_data_queue(gsm->dlci[0], msg);
1196 * @gsm: GSM channel
1206 static void gsm_control_modem(struct gsm_mux *gsm, const u8 *data, int clen)
1228 if (addr == 0 || addr >= NUM_DLCI || gsm->dlci[addr] == NULL)
1230 dlci = gsm->dlci[addr];
1253 gsm_control_reply(gsm, CMD_MSC, data, clen);
1258 * @gsm: GSM channel
1267 static void gsm_control_rls(struct gsm_mux *gsm, const u8 *data, int clen)
1286 if (addr == 0 || addr >= NUM_DLCI || gsm->dlci[addr] == NULL)
1293 port = &gsm->dlci[addr]->port;
1304 gsm_control_reply(gsm, CMD_RLS, data, clen);
1311 * @gsm: our GSM mux
1321 static void gsm_control_message(struct gsm_mux *gsm, unsigned int command,
1329 struct gsm_dlci *dlci = gsm->dlci[0];
1333 gsm->dead = true;
1340 gsm_control_reply(gsm, CMD_TEST, data, clen);
1344 gsm->constipated = false;
1345 gsm_control_reply(gsm, CMD_FCON, NULL, 0);
1347 spin_lock_irqsave(&gsm->tx_lock, flags);
1348 gsm_data_kick(gsm, NULL);
1349 spin_unlock_irqrestore(&gsm->tx_lock, flags);
1353 gsm->constipated = true;
1354 gsm_control_reply(gsm, CMD_FCOFF, NULL, 0);
1358 gsm_control_modem(gsm, data, clen);
1362 gsm_control_rls(gsm, data, clen);
1366 gsm_control_reply(gsm, CMD_PSC, NULL, 0);
1375 gsm_control_reply(gsm, CMD_NSC, buf, 1);
1382 * @gsm: our GSM mux
1393 static void gsm_control_response(struct gsm_mux *gsm, unsigned int command,
1399 spin_lock_irqsave(&gsm->control_lock, flags);
1401 ctrl = gsm->pending_cmd;
1406 del_timer(&gsm->t2_timer);
1407 gsm->pending_cmd = NULL;
1412 wake_up(&gsm->event);
1414 spin_unlock_irqrestore(&gsm->control_lock, flags);
1419 * @gsm: gsm mux
1425 static void gsm_control_transmit(struct gsm_mux *gsm, struct gsm_control *ctrl)
1427 struct gsm_msg *msg = gsm_data_alloc(gsm, 0, ctrl->len + 2, gsm->ftype);
1433 gsm_data_queue(gsm->dlci[0], msg);
1438 * @t: timer contained in our gsm object
1444 * gsm->pending_cmd will be NULL and we just let the timer expire.
1449 struct gsm_mux *gsm = from_timer(gsm, t, t2_timer);
1452 spin_lock_irqsave(&gsm->control_lock, flags);
1453 ctrl = gsm->pending_cmd;
1455 if (gsm->cretries == 0 || !gsm->dlci[0] || gsm->dlci[0]->dead) {
1456 gsm->pending_cmd = NULL;
1459 spin_unlock_irqrestore(&gsm->control_lock, flags);
1460 wake_up(&gsm->event);
1463 gsm->cretries--;
1464 gsm_control_transmit(gsm, ctrl);
1465 mod_timer(&gsm->t2_timer, jiffies + gsm->t2 * HZ / 100);
1467 spin_unlock_irqrestore(&gsm->control_lock, flags);
1472 * @gsm: the GSM channel
1482 static struct gsm_control *gsm_control_send(struct gsm_mux *gsm,
1491 wait_event(gsm->event, gsm->pending_cmd == NULL);
1492 spin_lock_irqsave(&gsm->control_lock, flags);
1493 if (gsm->pending_cmd != NULL) {
1494 spin_unlock_irqrestore(&gsm->control_lock, flags);
1500 gsm->pending_cmd = ctrl;
1503 if (gsm->dlci[0]->mode == DLCI_MODE_ADM)
1504 gsm->cretries = 0;
1506 gsm->cretries = gsm->n2;
1508 mod_timer(&gsm->t2_timer, jiffies + gsm->t2 * HZ / 100);
1509 gsm_control_transmit(gsm, ctrl);
1510 spin_unlock_irqrestore(&gsm->control_lock, flags);
1516 * @gsm: GSM mux
1524 static int gsm_control_wait(struct gsm_mux *gsm, struct gsm_control *control)
1527 wait_event(gsm->event, control->done == 1);
1569 dlci->gsm->dead = true;
1570 wake_up(&dlci->gsm->event);
1592 wake_up(&dlci->gsm->event);
1613 struct gsm_mux *gsm = dlci->gsm;
1619 gsm_command(dlci->gsm, dlci->addr, SABM|PF);
1620 mod_timer(&dlci->t1, jiffies + gsm->t1 * HZ / 100);
1621 } else if (!dlci->addr && gsm->control == (DM | PF)) {
1635 gsm_command(dlci->gsm, dlci->addr, DISC|PF);
1636 mod_timer(&dlci->t1, jiffies + gsm->t1 * HZ / 100);
1658 struct gsm_mux *gsm = dlci->gsm;
1661 dlci->retries = gsm->n2;
1663 gsm_command(dlci->gsm, dlci->addr, SABM|PF);
1664 mod_timer(&dlci->t1, jiffies + gsm->t1 * HZ / 100);
1699 struct gsm_mux *gsm = dlci->gsm;
1702 dlci->retries = gsm->n2;
1704 gsm_command(dlci->gsm, dlci->addr, DISC|PF);
1705 mod_timer(&dlci->t1, jiffies + gsm->t1 * HZ / 100);
1780 gsm_control_message(dlci->gsm, command,
1783 gsm_control_response(dlci->gsm, command,
1796 * @gsm: GSM mux
1804 static struct gsm_dlci *gsm_dlci_alloc(struct gsm_mux *gsm, int addr)
1820 dlci->gsm = gsm;
1822 dlci->adaption = gsm->adaption;
1831 gsm->dlci[addr] = dlci;
1848 dlci->gsm->dlci[dlci->addr] = NULL;
1904 * @gsm: pointer to our gsm mux
1912 static void gsm_queue(struct gsm_mux *gsm)
1920 if ((gsm->control & ~PF) == UI)
1921 gsm->fcs = gsm_fcs_add_block(gsm->fcs, gsm->buf, gsm->len);
1922 if (gsm->encoding == 0) {
1923 /* WARNING: gsm->received_fcs is used for
1924 gsm->encoding = 0 only.
1927 gsm->fcs = gsm_fcs_add(gsm->fcs, gsm->received_fcs);
1929 if (gsm->fcs != GOOD_FCS) {
1930 gsm->bad_fcs++;
1932 pr_debug("BAD FCS %02x\n", gsm->fcs);
1935 address = gsm->address >> 1;
1939 cr = gsm->address & 1; /* C/R bit */
1941 gsm_print_packet("<--", address, cr, gsm->control, gsm->buf, gsm->len);
1943 cr ^= 1 - gsm->initiator; /* Flip so 1 always means command */
1944 dlci = gsm->dlci[address];
1946 switch (gsm->control) {
1951 dlci = gsm_dlci_alloc(gsm, address);
1955 gsm_response(gsm, address, DM);
1957 gsm_response(gsm, address, UA);
1965 gsm_response(gsm, address, DM);
1969 gsm_response(gsm, address, UA);
2005 gsm_response(gsm, address, DM|PF);
2008 dlci->data(dlci, gsm->buf, gsm->len);
2015 gsm->malformed++;
2022 * @gsm: gsm data for this ldisc instance
2025 * Receive bytes in gsm mode 0
2028 static void gsm0_receive(struct gsm_mux *gsm, unsigned char c)
2032 switch (gsm->state) {
2035 gsm->state = GSM_ADDRESS;
2036 gsm->address = 0;
2037 gsm->len = 0;
2038 gsm->fcs = INIT_FCS;
2042 gsm->fcs = gsm_fcs_add(gsm->fcs, c);
2043 if (gsm_read_ea(&gsm->address, c))
2044 gsm->state = GSM_CONTROL;
2047 gsm->fcs = gsm_fcs_add(gsm->fcs, c);
2048 gsm->control = c;
2049 gsm->state = GSM_LEN0;
2052 gsm->fcs = gsm_fcs_add(gsm->fcs, c);
2053 if (gsm_read_ea(&gsm->len, c)) {
2054 if (gsm->len > gsm->mru) {
2055 gsm->bad_size++;
2056 gsm->state = GSM_SEARCH;
2059 gsm->count = 0;
2060 if (!gsm->len)
2061 gsm->state = GSM_FCS;
2063 gsm->state = GSM_DATA;
2066 gsm->state = GSM_LEN1;
2069 gsm->fcs = gsm_fcs_add(gsm->fcs, c);
2071 gsm->len |= len << 7;
2072 if (gsm->len > gsm->mru) {
2073 gsm->bad_size++;
2074 gsm->state = GSM_SEARCH;
2077 gsm->count = 0;
2078 if (!gsm->len)
2079 gsm->state = GSM_FCS;
2081 gsm->state = GSM_DATA;
2084 gsm->buf[gsm->count++] = c;
2085 if (gsm->count == gsm->len)
2086 gsm->state = GSM_FCS;
2089 gsm->received_fcs = c;
2090 gsm_queue(gsm);
2091 gsm->state = GSM_SSOF;
2095 gsm->state = GSM_SEARCH;
2100 pr_debug("%s: unhandled state: %d\n", __func__, gsm->state);
2107 * @gsm: gsm data for this ldisc instance
2113 static void gsm1_receive(struct gsm_mux *gsm, unsigned char c)
2117 gsm->constipated = true;
2120 gsm->constipated = false;
2122 gsm_data_kick(gsm, NULL);
2128 if (gsm->state == GSM_DATA && gsm->count) {
2130 gsm->count--;
2131 gsm->fcs = gsm_fcs_add(gsm->fcs, gsm->buf[gsm->count]);
2132 gsm->len = gsm->count;
2133 gsm_queue(gsm);
2134 gsm->state = GSM_START;
2138 if (gsm->state != GSM_START) {
2139 if (gsm->state != GSM_SEARCH)
2140 gsm->malformed++;
2141 gsm->state = GSM_START;
2149 gsm->escape = true;
2154 if (gsm->state == GSM_SEARCH)
2157 if (gsm->escape) {
2159 gsm->escape = false;
2161 switch (gsm->state) {
2163 gsm->address = 0;
2164 gsm->state = GSM_ADDRESS;
2165 gsm->fcs = INIT_FCS;
2168 gsm->fcs = gsm_fcs_add(gsm->fcs, c);
2169 if (gsm_read_ea(&gsm->address, c))
2170 gsm->state = GSM_CONTROL;
2173 gsm->fcs = gsm_fcs_add(gsm->fcs, c);
2174 gsm->control = c;
2175 gsm->count = 0;
2176 gsm->state = GSM_DATA;
2179 if (gsm->count > gsm->mru) { /* Allow one for the FCS */
2180 gsm->state = GSM_OVERRUN;
2181 gsm->bad_size++;
2183 gsm->buf[gsm->count++] = c;
2188 pr_debug("%s: unhandled state: %d\n", __func__, gsm->state);
2195 * @gsm: ldisc data
2205 static void gsm_error(struct gsm_mux *gsm,
2208 gsm->state = GSM_SEARCH;
2209 gsm->io_error++;
2214 * @gsm: our mux
2222 static void gsm_cleanup_mux(struct gsm_mux *gsm, bool disc)
2228 gsm->dead = true;
2229 mutex_lock(&gsm->mutex);
2231 dlci = gsm->dlci[0];
2235 wait_event(gsm->event, dlci->state == DLCI_CLOSED);
2241 del_timer_sync(&gsm->t2_timer);
2244 if (gsm->has_devices) {
2245 gsm_unregister_devices(gsm_tty_driver, gsm->num);
2246 gsm->has_devices = false;
2249 if (gsm->dlci[i])
2250 gsm_dlci_release(gsm->dlci[i]);
2251 mutex_unlock(&gsm->mutex);
2253 tty_ldisc_flush(gsm->tty);
2254 list_for_each_entry_safe(txq, ntxq, &gsm->tx_list, list)
2256 INIT_LIST_HEAD(&gsm->tx_list);
2261 * @gsm: our mux
2268 static int gsm_activate_mux(struct gsm_mux *gsm)
2273 if (gsm->encoding == 0)
2274 gsm->receive = gsm0_receive;
2276 gsm->receive = gsm1_receive;
2278 ret = gsm_register_devices(gsm_tty_driver, gsm->num);
2282 dlci = gsm_dlci_alloc(gsm, 0);
2285 gsm->has_devices = true;
2286 gsm->dead = false; /* Tty opens are now permissible */
2292 * @gsm: mux to free
2296 static void gsm_free_mux(struct gsm_mux *gsm)
2301 if (gsm == gsm_mux[i]) {
2306 mutex_destroy(&gsm->mutex);
2307 kfree(gsm->txframe);
2308 kfree(gsm->buf);
2309 kfree(gsm);
2320 struct gsm_mux *gsm = container_of(ref, struct gsm_mux, ref);
2321 gsm_free_mux(gsm);
2324 static inline void mux_get(struct gsm_mux *gsm)
2329 kref_get(&gsm->ref);
2333 static inline void mux_put(struct gsm_mux *gsm)
2338 kref_put(&gsm->ref, gsm_free_muxr);
2342 static inline unsigned int mux_num_to_base(struct gsm_mux *gsm)
2344 return gsm->num * NUM_DLCI;
2361 struct gsm_mux *gsm = kzalloc(sizeof(struct gsm_mux), GFP_KERNEL);
2362 if (gsm == NULL)
2364 gsm->buf = kmalloc(MAX_MRU + 1, GFP_KERNEL);
2365 if (gsm->buf == NULL) {
2366 kfree(gsm);
2369 gsm->txframe = kmalloc(2 * (MAX_MTU + PROT_OVERHEAD - 1), GFP_KERNEL);
2370 if (gsm->txframe == NULL) {
2371 kfree(gsm->buf);
2372 kfree(gsm);
2375 spin_lock_init(&gsm->lock);
2376 mutex_init(&gsm->mutex);
2377 kref_init(&gsm->ref);
2378 INIT_LIST_HEAD(&gsm->tx_list);
2379 timer_setup(&gsm->t2_timer, gsm_control_retransmit, 0);
2380 init_waitqueue_head(&gsm->event);
2381 spin_lock_init(&gsm->control_lock);
2382 spin_lock_init(&gsm->tx_lock);
2384 gsm->t1 = T1;
2385 gsm->t2 = T2;
2386 gsm->n2 = N2;
2387 gsm->ftype = UIH;
2388 gsm->adaption = 1;
2389 gsm->encoding = 1;
2390 gsm->mru = 64; /* Default to encoding 1 so these should be 64 */
2391 gsm->mtu = 64;
2392 gsm->dead = true; /* Avoid early tty opens */
2400 gsm_mux[i] = gsm;
2401 gsm->num = i;
2407 mutex_destroy(&gsm->mutex);
2408 kfree(gsm->txframe);
2409 kfree(gsm->buf);
2410 kfree(gsm);
2414 return gsm;
2417 static void gsm_copy_config_values(struct gsm_mux *gsm,
2421 c->adaption = gsm->adaption;
2422 c->encapsulation = gsm->encoding;
2423 c->initiator = gsm->initiator;
2424 c->t1 = gsm->t1;
2425 c->t2 = gsm->t2;
2427 c->n2 = gsm->n2;
2428 if (gsm->ftype == UIH)
2432 pr_debug("Ftype %d i %d\n", gsm->ftype, c->i);
2433 c->mru = gsm->mru;
2434 c->mtu = gsm->mtu;
2438 static int gsm_config(struct gsm_mux *gsm, struct gsm_config *c)
2463 if (c->t1 != 0 && c->t1 != gsm->t1)
2465 if (c->t2 != 0 && c->t2 != gsm->t2)
2467 if (c->encapsulation != gsm->encoding)
2469 if (c->adaption != gsm->adaption)
2472 if (c->initiator != gsm->initiator)
2474 if (c->mru != gsm->mru)
2476 if (c->mtu != gsm->mtu)
2485 gsm_cleanup_mux(gsm, true);
2487 gsm->initiator = c->initiator;
2488 gsm->mru = c->mru;
2489 gsm->mtu = c->mtu;
2490 gsm->encoding = c->encapsulation;
2491 gsm->adaption = c->adaption;
2492 gsm->n2 = c->n2;
2495 gsm->ftype = UIH;
2497 gsm->ftype = UI;
2500 gsm->t1 = c->t1;
2502 gsm->t2 = c->t2;
2508 if (gsm->dead) {
2509 ret = gsm_activate_mux(gsm);
2512 if (gsm->initiator)
2513 gsm_dlci_begin_open(gsm->dlci[0]);
2520 * @gsm: our mux
2528 static int gsmld_output(struct gsm_mux *gsm, u8 *data, int len)
2530 if (tty_write_room(gsm->tty) < len) {
2531 set_bit(TTY_DO_WRITE_WAKEUP, &gsm->tty->flags);
2537 gsm->tty->ops->write(gsm->tty, data, len);
2544 * @gsm: our mux
2551 static void gsmld_attach_gsm(struct tty_struct *tty, struct gsm_mux *gsm)
2553 gsm->tty = tty_kref_get(tty);
2555 gsm->old_c_iflag = tty->termios.c_iflag;
2562 * @gsm: mux
2567 static void gsmld_detach_gsm(struct tty_struct *tty, struct gsm_mux *gsm)
2569 WARN_ON(tty != gsm->tty);
2571 gsm->tty->termios.c_iflag = gsm->old_c_iflag;
2572 tty_kref_put(gsm->tty);
2573 gsm->tty = NULL;
2579 struct gsm_mux *gsm = tty->disc_data;
2591 if (gsm->receive)
2592 gsm->receive(gsm, *cp);
2598 gsm_error(gsm, *cp, flags);
2635 struct gsm_mux *gsm = tty->disc_data;
2641 gsm_cleanup_mux(gsm, false);
2643 gsmld_detach_gsm(tty, gsm);
2647 mux_put(gsm);
2662 struct gsm_mux *gsm;
2671 gsm = gsm_alloc_mux();
2672 if (gsm == NULL)
2675 tty->disc_data = gsm;
2679 gsm->encoding = 1;
2681 gsmld_attach_gsm(tty, gsm);
2683 timer_setup(&gsm->t2_timer, gsm_control_retransmit, 0);
2699 struct gsm_mux *gsm = tty->disc_data;
2704 spin_lock_irqsave(&gsm->tx_lock, flags);
2705 gsm_data_kick(gsm, NULL);
2706 if (gsm->tx_bytes < TX_THRESH_LO) {
2707 gsm_dlci_data_sweep(gsm);
2709 spin_unlock_irqrestore(&gsm->tx_lock, flags);
2751 struct gsm_mux *gsm = tty->disc_data;
2756 if (!gsm)
2760 spin_lock_irqsave(&gsm->tx_lock, flags);
2766 spin_unlock_irqrestore(&gsm->tx_lock, flags);
2789 struct gsm_mux *gsm = tty->disc_data;
2794 if (gsm->dead)
2809 struct gsm_mux *gsm = tty->disc_data;
2814 gsm_copy_config_values(gsm, &c);
2821 return gsm_config(gsm, &c);
2823 base = mux_num_to_base(gsm);
2997 netname = "gsm%d";
3006 net->mtu = dlci->gsm->mtu;
3008 net->max_mtu = dlci->gsm->mtu;
3065 ctrl = gsm_control_send(dlci->gsm, CMD_MSC, modembits, len);
3068 return gsm_control_wait(dlci->gsm, ctrl);
3074 struct gsm_mux *gsm = dlci->gsm;
3086 if (gsm->encoding == 0 && gsm->dlci[0]->mode == DLCI_MODE_ADM &&
3115 struct gsm_mux *gsm;
3131 gsm = gsm_mux[mux];
3132 if (gsm->dead)
3138 mutex_lock(&gsm->mutex);
3139 if (gsm->dlci[0] && gsm->dlci[0]->state != DLCI_OPEN) {
3140 mutex_unlock(&gsm->mutex);
3143 dlci = gsm->dlci[line];
3146 dlci = gsm_dlci_alloc(gsm, line);
3149 mutex_unlock(&gsm->mutex);
3156 mutex_unlock(&gsm->mutex);
3161 dlci_get(gsm->dlci[0]);
3162 mux_get(gsm);
3164 mutex_unlock(&gsm->mutex);
3173 struct gsm_mux *gsm = dlci->gsm;
3183 if (gsm->initiator)
3393 struct gsm_mux *gsm = dlci->gsm;
3396 dlci_put(gsm->dlci[0]);
3397 mux_put(gsm);