gsm 64 drivers/gpu/drm/i915/gvt/dmabuf.c gtt_entries = (gen8_pte_t __iomem *)dev_priv->ggtt.gsm + gsm 280 drivers/gpu/drm/i915/gvt/gtt.c void __iomem *addr = (gen8_pte_t __iomem *)dev_priv->ggtt.gsm + index; gsm 295 drivers/gpu/drm/i915/gvt/gtt.c void __iomem *addr = (gen8_pte_t __iomem *)dev_priv->ggtt.gsm + index; gsm 1827 drivers/gpu/drm/i915/i915_gem_gtt.c ppgtt->pd_addr = (gen6_pte_t __iomem *)ggtt->gsm + ggtt_offset; gsm 2182 drivers/gpu/drm/i915/i915_gem_gtt.c (gen8_pte_t __iomem *)ggtt->gsm + offset / I915_GTT_PAGE_SIZE; gsm 2205 drivers/gpu/drm/i915/i915_gem_gtt.c gtt_entries = (gen8_pte_t __iomem *)ggtt->gsm; gsm 2225 drivers/gpu/drm/i915/i915_gem_gtt.c (gen6_pte_t __iomem *)ggtt->gsm + offset / I915_GTT_PAGE_SIZE; gsm 2244 drivers/gpu/drm/i915/i915_gem_gtt.c gen6_pte_t __iomem *entries = (gen6_pte_t __iomem *)ggtt->gsm; gsm 2271 drivers/gpu/drm/i915/i915_gem_gtt.c (gen8_pte_t __iomem *)ggtt->gsm + first_entry; gsm 2385 drivers/gpu/drm/i915/i915_gem_gtt.c (gen6_pte_t __iomem *)ggtt->gsm + first_entry; gsm 2855 drivers/gpu/drm/i915/i915_gem_gtt.c ggtt->gsm = ioremap_nocache(phys_addr, size); gsm 2857 drivers/gpu/drm/i915/i915_gem_gtt.c ggtt->gsm = ioremap_wc(phys_addr, size); gsm 2858 drivers/gpu/drm/i915/i915_gem_gtt.c if (!ggtt->gsm) { gsm 2867 drivers/gpu/drm/i915/i915_gem_gtt.c iounmap(ggtt->gsm); gsm 2963 drivers/gpu/drm/i915/i915_gem_gtt.c iounmap(ggtt->gsm); gsm 394 drivers/gpu/drm/i915/i915_gem_gtt.h void __iomem *gsm; gsm 114 drivers/tty/n_gsm.c struct gsm_mux *gsm; gsm 218 drivers/tty/n_gsm.c void (*receive)(struct gsm_mux *gsm, u8 ch); gsm 219 drivers/tty/n_gsm.c void (*error)(struct gsm_mux *gsm, u8 ch, u8 flag); gsm 559 drivers/tty/n_gsm.c static void gsm_send(struct gsm_mux *gsm, int addr, int cr, int control) gsm 565 drivers/tty/n_gsm.c switch (gsm->encoding) { gsm 593 drivers/tty/n_gsm.c gsm->output(gsm, cbuf, len); gsm 606 drivers/tty/n_gsm.c static inline void gsm_response(struct gsm_mux *gsm, int addr, int control) gsm 608 drivers/tty/n_gsm.c gsm_send(gsm, addr, 0, control); gsm 620 drivers/tty/n_gsm.c static inline void gsm_command(struct gsm_mux *gsm, int addr, int control) gsm 622 drivers/tty/n_gsm.c gsm_send(gsm, addr, 1, control); gsm 641 drivers/tty/n_gsm.c static struct gsm_msg *gsm_data_alloc(struct gsm_mux *gsm, u8 addr, int len, gsm 668 drivers/tty/n_gsm.c static void gsm_data_kick(struct gsm_mux *gsm) gsm 674 drivers/tty/n_gsm.c list_for_each_entry_safe(msg, nmsg, &gsm->tx_list, list) { gsm 675 drivers/tty/n_gsm.c if (gsm->constipated && msg->addr) gsm 677 drivers/tty/n_gsm.c if (gsm->encoding != 0) { gsm 678 drivers/tty/n_gsm.c gsm->txframe[0] = GSM1_SOF; gsm 680 drivers/tty/n_gsm.c gsm->txframe + 1, msg->len); gsm 681 drivers/tty/n_gsm.c gsm->txframe[len + 1] = GSM1_SOF; gsm 684 drivers/tty/n_gsm.c gsm->txframe[0] = GSM0_SOF; gsm 685 drivers/tty/n_gsm.c memcpy(gsm->txframe + 1 , msg->data, msg->len); gsm 686 drivers/tty/n_gsm.c gsm->txframe[msg->len + 1] = GSM0_SOF; gsm 693 drivers/tty/n_gsm.c gsm->txframe, len); gsm 695 drivers/tty/n_gsm.c if (gsm->output(gsm, gsm->txframe + skip_sof, gsm 699 drivers/tty/n_gsm.c gsm->tx_bytes -= msg->len; gsm 721 drivers/tty/n_gsm.c struct gsm_mux *gsm = dlci->gsm; gsm 726 drivers/tty/n_gsm.c if (gsm->encoding == 0) { gsm 736 drivers/tty/n_gsm.c if (gsm->initiator) gsm 746 drivers/tty/n_gsm.c gsm_print_packet("Q> ", msg->addr, gsm->initiator, msg->ctrl, gsm 755 drivers/tty/n_gsm.c list_add_tail(&msg->list, &gsm->tx_list); gsm 756 drivers/tty/n_gsm.c gsm->tx_bytes += msg->len; gsm 757 drivers/tty/n_gsm.c gsm_data_kick(gsm); gsm 773 drivers/tty/n_gsm.c spin_lock_irqsave(&dlci->gsm->tx_lock, flags); gsm 775 drivers/tty/n_gsm.c spin_unlock_irqrestore(&dlci->gsm->tx_lock, flags); gsm 790 drivers/tty/n_gsm.c static int gsm_dlci_data_output(struct gsm_mux *gsm, struct gsm_dlci *dlci) gsm 804 drivers/tty/n_gsm.c if (len > gsm->mtu) gsm 805 drivers/tty/n_gsm.c len = gsm->mtu; gsm 809 drivers/tty/n_gsm.c msg = gsm_data_alloc(gsm, dlci->addr, size, gsm->ftype); gsm 843 drivers/tty/n_gsm.c static int gsm_dlci_data_output_framed(struct gsm_mux *gsm, gsm 866 drivers/tty/n_gsm.c if (len > gsm->mtu) { gsm 873 drivers/tty/n_gsm.c len = gsm->mtu; gsm 878 drivers/tty/n_gsm.c msg = gsm_data_alloc(gsm, dlci->addr, size, gsm->ftype); gsm 917 drivers/tty/n_gsm.c static void gsm_dlci_data_sweep(struct gsm_mux *gsm) gsm 926 drivers/tty/n_gsm.c if (gsm->tx_bytes > TX_THRESH_HI) gsm 928 drivers/tty/n_gsm.c dlci = gsm->dlci[i]; gsm 934 drivers/tty/n_gsm.c len = gsm_dlci_data_output(gsm, dlci); gsm 936 drivers/tty/n_gsm.c len = gsm_dlci_data_output_framed(gsm, dlci); gsm 962 drivers/tty/n_gsm.c spin_lock_irqsave(&dlci->gsm->tx_lock, flags); gsm 964 drivers/tty/n_gsm.c sweep = (dlci->gsm->tx_bytes < TX_THRESH_LO); gsm 965 drivers/tty/n_gsm.c if (dlci->gsm->tx_bytes == 0) { gsm 967 drivers/tty/n_gsm.c gsm_dlci_data_output_framed(dlci->gsm, dlci); gsm 969 drivers/tty/n_gsm.c gsm_dlci_data_output(dlci->gsm, dlci); gsm 972 drivers/tty/n_gsm.c gsm_dlci_data_sweep(dlci->gsm); gsm 973 drivers/tty/n_gsm.c spin_unlock_irqrestore(&dlci->gsm->tx_lock, flags); gsm 991 drivers/tty/n_gsm.c static void gsm_control_reply(struct gsm_mux *gsm, int cmd, const u8 *data, gsm 995 drivers/tty/n_gsm.c msg = gsm_data_alloc(gsm, 0, dlen + 2, gsm->ftype); gsm 1001 drivers/tty/n_gsm.c gsm_data_queue(gsm->dlci[0], msg); gsm 1076 drivers/tty/n_gsm.c static void gsm_control_modem(struct gsm_mux *gsm, const u8 *data, int clen) gsm 1098 drivers/tty/n_gsm.c if (addr == 0 || addr >= NUM_DLCI || gsm->dlci[addr] == NULL) gsm 1100 drivers/tty/n_gsm.c dlci = gsm->dlci[addr]; gsm 1123 drivers/tty/n_gsm.c gsm_control_reply(gsm, CMD_MSC, data, clen); gsm 1137 drivers/tty/n_gsm.c static void gsm_control_rls(struct gsm_mux *gsm, const u8 *data, int clen) gsm 1156 drivers/tty/n_gsm.c if (addr == 0 || addr >= NUM_DLCI || gsm->dlci[addr] == NULL) gsm 1163 drivers/tty/n_gsm.c port = &gsm->dlci[addr]->port; gsm 1174 drivers/tty/n_gsm.c gsm_control_reply(gsm, CMD_RLS, data, clen); gsm 1191 drivers/tty/n_gsm.c static void gsm_control_message(struct gsm_mux *gsm, unsigned int command, gsm 1199 drivers/tty/n_gsm.c struct gsm_dlci *dlci = gsm->dlci[0]; gsm 1203 drivers/tty/n_gsm.c gsm->dead = 1; gsm 1210 drivers/tty/n_gsm.c gsm_control_reply(gsm, CMD_TEST, data, clen); gsm 1214 drivers/tty/n_gsm.c gsm->constipated = 0; gsm 1215 drivers/tty/n_gsm.c gsm_control_reply(gsm, CMD_FCON, NULL, 0); gsm 1217 drivers/tty/n_gsm.c spin_lock_irqsave(&gsm->tx_lock, flags); gsm 1218 drivers/tty/n_gsm.c gsm_data_kick(gsm); gsm 1219 drivers/tty/n_gsm.c spin_unlock_irqrestore(&gsm->tx_lock, flags); gsm 1223 drivers/tty/n_gsm.c gsm->constipated = 1; gsm 1224 drivers/tty/n_gsm.c gsm_control_reply(gsm, CMD_FCOFF, NULL, 0); gsm 1228 drivers/tty/n_gsm.c gsm_control_modem(gsm, data, clen); gsm 1232 drivers/tty/n_gsm.c gsm_control_rls(gsm, data, clen); gsm 1236 drivers/tty/n_gsm.c gsm_control_reply(gsm, CMD_PSC, NULL, 0); gsm 1245 drivers/tty/n_gsm.c gsm_control_reply(gsm, CMD_NSC, buf, 1); gsm 1263 drivers/tty/n_gsm.c static void gsm_control_response(struct gsm_mux *gsm, unsigned int command, gsm 1269 drivers/tty/n_gsm.c spin_lock_irqsave(&gsm->control_lock, flags); gsm 1271 drivers/tty/n_gsm.c ctrl = gsm->pending_cmd; gsm 1276 drivers/tty/n_gsm.c del_timer(&gsm->t2_timer); gsm 1277 drivers/tty/n_gsm.c gsm->pending_cmd = NULL; gsm 1282 drivers/tty/n_gsm.c wake_up(&gsm->event); gsm 1284 drivers/tty/n_gsm.c spin_unlock_irqrestore(&gsm->control_lock, flags); gsm 1295 drivers/tty/n_gsm.c static void gsm_control_transmit(struct gsm_mux *gsm, struct gsm_control *ctrl) gsm 1297 drivers/tty/n_gsm.c struct gsm_msg *msg = gsm_data_alloc(gsm, 0, ctrl->len + 1, gsm->ftype); gsm 1302 drivers/tty/n_gsm.c gsm_data_queue(gsm->dlci[0], msg); gsm 1318 drivers/tty/n_gsm.c struct gsm_mux *gsm = from_timer(gsm, t, t2_timer); gsm 1321 drivers/tty/n_gsm.c spin_lock_irqsave(&gsm->control_lock, flags); gsm 1322 drivers/tty/n_gsm.c ctrl = gsm->pending_cmd; gsm 1324 drivers/tty/n_gsm.c gsm->cretries--; gsm 1325 drivers/tty/n_gsm.c if (gsm->cretries == 0) { gsm 1326 drivers/tty/n_gsm.c gsm->pending_cmd = NULL; gsm 1329 drivers/tty/n_gsm.c spin_unlock_irqrestore(&gsm->control_lock, flags); gsm 1330 drivers/tty/n_gsm.c wake_up(&gsm->event); gsm 1333 drivers/tty/n_gsm.c gsm_control_transmit(gsm, ctrl); gsm 1334 drivers/tty/n_gsm.c mod_timer(&gsm->t2_timer, jiffies + gsm->t2 * HZ / 100); gsm 1336 drivers/tty/n_gsm.c spin_unlock_irqrestore(&gsm->control_lock, flags); gsm 1351 drivers/tty/n_gsm.c static struct gsm_control *gsm_control_send(struct gsm_mux *gsm, gsm 1360 drivers/tty/n_gsm.c wait_event(gsm->event, gsm->pending_cmd == NULL); gsm 1361 drivers/tty/n_gsm.c spin_lock_irqsave(&gsm->control_lock, flags); gsm 1362 drivers/tty/n_gsm.c if (gsm->pending_cmd != NULL) { gsm 1363 drivers/tty/n_gsm.c spin_unlock_irqrestore(&gsm->control_lock, flags); gsm 1369 drivers/tty/n_gsm.c gsm->pending_cmd = ctrl; gsm 1372 drivers/tty/n_gsm.c if (gsm->dlci[0]->mode == DLCI_MODE_ADM) gsm 1373 drivers/tty/n_gsm.c gsm->cretries = 1; gsm 1375 drivers/tty/n_gsm.c gsm->cretries = gsm->n2; gsm 1377 drivers/tty/n_gsm.c mod_timer(&gsm->t2_timer, jiffies + gsm->t2 * HZ / 100); gsm 1378 drivers/tty/n_gsm.c gsm_control_transmit(gsm, ctrl); gsm 1379 drivers/tty/n_gsm.c spin_unlock_irqrestore(&gsm->control_lock, flags); gsm 1393 drivers/tty/n_gsm.c static int gsm_control_wait(struct gsm_mux *gsm, struct gsm_control *control) gsm 1396 drivers/tty/n_gsm.c wait_event(gsm->event, control->done == 1); gsm 1429 drivers/tty/n_gsm.c dlci->gsm->dead = 1; gsm 1430 drivers/tty/n_gsm.c wake_up(&dlci->gsm->event); gsm 1451 drivers/tty/n_gsm.c wake_up(&dlci->gsm->event); gsm 1472 drivers/tty/n_gsm.c struct gsm_mux *gsm = dlci->gsm; gsm 1478 drivers/tty/n_gsm.c gsm_command(dlci->gsm, dlci->addr, SABM|PF); gsm 1479 drivers/tty/n_gsm.c mod_timer(&dlci->t1, jiffies + gsm->t1 * HZ / 100); gsm 1480 drivers/tty/n_gsm.c } else if (!dlci->addr && gsm->control == (DM | PF)) { gsm 1494 drivers/tty/n_gsm.c gsm_command(dlci->gsm, dlci->addr, DISC|PF); gsm 1495 drivers/tty/n_gsm.c mod_timer(&dlci->t1, jiffies + gsm->t1 * HZ / 100); gsm 1514 drivers/tty/n_gsm.c struct gsm_mux *gsm = dlci->gsm; gsm 1517 drivers/tty/n_gsm.c dlci->retries = gsm->n2; gsm 1519 drivers/tty/n_gsm.c gsm_command(dlci->gsm, dlci->addr, SABM|PF); gsm 1520 drivers/tty/n_gsm.c mod_timer(&dlci->t1, jiffies + gsm->t1 * HZ / 100); gsm 1536 drivers/tty/n_gsm.c struct gsm_mux *gsm = dlci->gsm; gsm 1539 drivers/tty/n_gsm.c dlci->retries = gsm->n2; gsm 1541 drivers/tty/n_gsm.c gsm_command(dlci->gsm, dlci->addr, DISC|PF); gsm 1542 drivers/tty/n_gsm.c mod_timer(&dlci->t1, jiffies + gsm->t1 * HZ / 100); gsm 1617 drivers/tty/n_gsm.c gsm_control_message(dlci->gsm, command, gsm 1620 drivers/tty/n_gsm.c gsm_control_response(dlci->gsm, command, gsm 1641 drivers/tty/n_gsm.c static struct gsm_dlci *gsm_dlci_alloc(struct gsm_mux *gsm, int addr) gsm 1658 drivers/tty/n_gsm.c dlci->gsm = gsm; gsm 1660 drivers/tty/n_gsm.c dlci->adaption = gsm->adaption; gsm 1666 drivers/tty/n_gsm.c gsm->dlci[addr] = dlci; gsm 1683 drivers/tty/n_gsm.c dlci->gsm->dlci[dlci->addr] = NULL; gsm 1742 drivers/tty/n_gsm.c static void gsm_queue(struct gsm_mux *gsm) gsm 1750 drivers/tty/n_gsm.c if ((gsm->control & ~PF) == UI) gsm 1751 drivers/tty/n_gsm.c gsm->fcs = gsm_fcs_add_block(gsm->fcs, gsm->buf, gsm->len); gsm 1752 drivers/tty/n_gsm.c if (gsm->encoding == 0) { gsm 1757 drivers/tty/n_gsm.c gsm->fcs = gsm_fcs_add(gsm->fcs, gsm->received_fcs); gsm 1759 drivers/tty/n_gsm.c if (gsm->fcs != GOOD_FCS) { gsm 1760 drivers/tty/n_gsm.c gsm->bad_fcs++; gsm 1762 drivers/tty/n_gsm.c pr_debug("BAD FCS %02x\n", gsm->fcs); gsm 1765 drivers/tty/n_gsm.c address = gsm->address >> 1; gsm 1769 drivers/tty/n_gsm.c cr = gsm->address & 1; /* C/R bit */ gsm 1771 drivers/tty/n_gsm.c gsm_print_packet("<--", address, cr, gsm->control, gsm->buf, gsm->len); gsm 1773 drivers/tty/n_gsm.c cr ^= 1 - gsm->initiator; /* Flip so 1 always means command */ gsm 1774 drivers/tty/n_gsm.c dlci = gsm->dlci[address]; gsm 1776 drivers/tty/n_gsm.c switch (gsm->control) { gsm 1781 drivers/tty/n_gsm.c dlci = gsm_dlci_alloc(gsm, address); gsm 1785 drivers/tty/n_gsm.c gsm_response(gsm, address, DM); gsm 1787 drivers/tty/n_gsm.c gsm_response(gsm, address, UA); gsm 1795 drivers/tty/n_gsm.c gsm_response(gsm, address, DM); gsm 1799 drivers/tty/n_gsm.c gsm_response(gsm, address, UA); gsm 1832 drivers/tty/n_gsm.c gsm_command(gsm, address, DM|PF); gsm 1835 drivers/tty/n_gsm.c dlci->data(dlci, gsm->buf, gsm->len); gsm 1842 drivers/tty/n_gsm.c gsm->malformed++; gsm 1855 drivers/tty/n_gsm.c static void gsm0_receive(struct gsm_mux *gsm, unsigned char c) gsm 1859 drivers/tty/n_gsm.c switch (gsm->state) { gsm 1862 drivers/tty/n_gsm.c gsm->state = GSM_ADDRESS; gsm 1863 drivers/tty/n_gsm.c gsm->address = 0; gsm 1864 drivers/tty/n_gsm.c gsm->len = 0; gsm 1865 drivers/tty/n_gsm.c gsm->fcs = INIT_FCS; gsm 1869 drivers/tty/n_gsm.c gsm->fcs = gsm_fcs_add(gsm->fcs, c); gsm 1870 drivers/tty/n_gsm.c if (gsm_read_ea(&gsm->address, c)) gsm 1871 drivers/tty/n_gsm.c gsm->state = GSM_CONTROL; gsm 1874 drivers/tty/n_gsm.c gsm->fcs = gsm_fcs_add(gsm->fcs, c); gsm 1875 drivers/tty/n_gsm.c gsm->control = c; gsm 1876 drivers/tty/n_gsm.c gsm->state = GSM_LEN0; gsm 1879 drivers/tty/n_gsm.c gsm->fcs = gsm_fcs_add(gsm->fcs, c); gsm 1880 drivers/tty/n_gsm.c if (gsm_read_ea(&gsm->len, c)) { gsm 1881 drivers/tty/n_gsm.c if (gsm->len > gsm->mru) { gsm 1882 drivers/tty/n_gsm.c gsm->bad_size++; gsm 1883 drivers/tty/n_gsm.c gsm->state = GSM_SEARCH; gsm 1886 drivers/tty/n_gsm.c gsm->count = 0; gsm 1887 drivers/tty/n_gsm.c if (!gsm->len) gsm 1888 drivers/tty/n_gsm.c gsm->state = GSM_FCS; gsm 1890 drivers/tty/n_gsm.c gsm->state = GSM_DATA; gsm 1893 drivers/tty/n_gsm.c gsm->state = GSM_LEN1; gsm 1896 drivers/tty/n_gsm.c gsm->fcs = gsm_fcs_add(gsm->fcs, c); gsm 1898 drivers/tty/n_gsm.c gsm->len |= len << 7; gsm 1899 drivers/tty/n_gsm.c if (gsm->len > gsm->mru) { gsm 1900 drivers/tty/n_gsm.c gsm->bad_size++; gsm 1901 drivers/tty/n_gsm.c gsm->state = GSM_SEARCH; gsm 1904 drivers/tty/n_gsm.c gsm->count = 0; gsm 1905 drivers/tty/n_gsm.c if (!gsm->len) gsm 1906 drivers/tty/n_gsm.c gsm->state = GSM_FCS; gsm 1908 drivers/tty/n_gsm.c gsm->state = GSM_DATA; gsm 1911 drivers/tty/n_gsm.c gsm->buf[gsm->count++] = c; gsm 1912 drivers/tty/n_gsm.c if (gsm->count == gsm->len) gsm 1913 drivers/tty/n_gsm.c gsm->state = GSM_FCS; gsm 1916 drivers/tty/n_gsm.c gsm->received_fcs = c; gsm 1917 drivers/tty/n_gsm.c gsm_queue(gsm); gsm 1918 drivers/tty/n_gsm.c gsm->state = GSM_SSOF; gsm 1922 drivers/tty/n_gsm.c gsm->state = GSM_SEARCH; gsm 1937 drivers/tty/n_gsm.c static void gsm1_receive(struct gsm_mux *gsm, unsigned char c) gsm 1942 drivers/tty/n_gsm.c if (gsm->state == GSM_DATA && gsm->count) { gsm 1944 drivers/tty/n_gsm.c gsm->count--; gsm 1945 drivers/tty/n_gsm.c gsm->fcs = gsm_fcs_add(gsm->fcs, gsm->buf[gsm->count]); gsm 1946 drivers/tty/n_gsm.c gsm->len = gsm->count; gsm 1947 drivers/tty/n_gsm.c gsm_queue(gsm); gsm 1948 drivers/tty/n_gsm.c gsm->state = GSM_START; gsm 1952 drivers/tty/n_gsm.c if (gsm->state != GSM_START) { gsm 1953 drivers/tty/n_gsm.c gsm->malformed++; gsm 1954 drivers/tty/n_gsm.c gsm->state = GSM_START; gsm 1962 drivers/tty/n_gsm.c gsm->escape = 1; gsm 1967 drivers/tty/n_gsm.c if (gsm->state == GSM_SEARCH) gsm 1970 drivers/tty/n_gsm.c if (gsm->escape) { gsm 1972 drivers/tty/n_gsm.c gsm->escape = 0; gsm 1974 drivers/tty/n_gsm.c switch (gsm->state) { gsm 1976 drivers/tty/n_gsm.c gsm->address = 0; gsm 1977 drivers/tty/n_gsm.c gsm->state = GSM_ADDRESS; gsm 1978 drivers/tty/n_gsm.c gsm->fcs = INIT_FCS; gsm 1981 drivers/tty/n_gsm.c gsm->fcs = gsm_fcs_add(gsm->fcs, c); gsm 1982 drivers/tty/n_gsm.c if (gsm_read_ea(&gsm->address, c)) gsm 1983 drivers/tty/n_gsm.c gsm->state = GSM_CONTROL; gsm 1986 drivers/tty/n_gsm.c gsm->fcs = gsm_fcs_add(gsm->fcs, c); gsm 1987 drivers/tty/n_gsm.c gsm->control = c; gsm 1988 drivers/tty/n_gsm.c gsm->count = 0; gsm 1989 drivers/tty/n_gsm.c gsm->state = GSM_DATA; gsm 1992 drivers/tty/n_gsm.c if (gsm->count > gsm->mru) { /* Allow one for the FCS */ gsm 1993 drivers/tty/n_gsm.c gsm->state = GSM_OVERRUN; gsm 1994 drivers/tty/n_gsm.c gsm->bad_size++; gsm 1996 drivers/tty/n_gsm.c gsm->buf[gsm->count++] = c; gsm 2015 drivers/tty/n_gsm.c static void gsm_error(struct gsm_mux *gsm, gsm 2018 drivers/tty/n_gsm.c gsm->state = GSM_SEARCH; gsm 2019 drivers/tty/n_gsm.c gsm->io_error++; gsm 2022 drivers/tty/n_gsm.c static int gsm_disconnect(struct gsm_mux *gsm) gsm 2024 drivers/tty/n_gsm.c struct gsm_dlci *dlci = gsm->dlci[0]; gsm 2032 drivers/tty/n_gsm.c gc = gsm_control_send(gsm, CMD_CLD, NULL, 0); gsm 2034 drivers/tty/n_gsm.c gsm_control_wait(gsm, gc); gsm 2036 drivers/tty/n_gsm.c del_timer_sync(&gsm->t2_timer); gsm 2040 drivers/tty/n_gsm.c wait_event_interruptible(gsm->event, gsm 2058 drivers/tty/n_gsm.c static void gsm_cleanup_mux(struct gsm_mux *gsm) gsm 2061 drivers/tty/n_gsm.c struct gsm_dlci *dlci = gsm->dlci[0]; gsm 2064 drivers/tty/n_gsm.c gsm->dead = 1; gsm 2068 drivers/tty/n_gsm.c if (gsm_mux[i] == gsm) { gsm 2078 drivers/tty/n_gsm.c del_timer_sync(&gsm->t2_timer); gsm 2084 drivers/tty/n_gsm.c mutex_lock(&gsm->mutex); gsm 2086 drivers/tty/n_gsm.c if (gsm->dlci[i]) gsm 2087 drivers/tty/n_gsm.c gsm_dlci_release(gsm->dlci[i]); gsm 2088 drivers/tty/n_gsm.c mutex_unlock(&gsm->mutex); gsm 2090 drivers/tty/n_gsm.c list_for_each_entry_safe(txq, ntxq, &gsm->tx_list, list) gsm 2092 drivers/tty/n_gsm.c INIT_LIST_HEAD(&gsm->tx_list); gsm 2104 drivers/tty/n_gsm.c static int gsm_activate_mux(struct gsm_mux *gsm) gsm 2109 drivers/tty/n_gsm.c timer_setup(&gsm->t2_timer, gsm_control_retransmit, 0); gsm 2110 drivers/tty/n_gsm.c init_waitqueue_head(&gsm->event); gsm 2111 drivers/tty/n_gsm.c spin_lock_init(&gsm->control_lock); gsm 2112 drivers/tty/n_gsm.c spin_lock_init(&gsm->tx_lock); gsm 2114 drivers/tty/n_gsm.c if (gsm->encoding == 0) gsm 2115 drivers/tty/n_gsm.c gsm->receive = gsm0_receive; gsm 2117 drivers/tty/n_gsm.c gsm->receive = gsm1_receive; gsm 2118 drivers/tty/n_gsm.c gsm->error = gsm_error; gsm 2123 drivers/tty/n_gsm.c gsm->num = i; gsm 2124 drivers/tty/n_gsm.c gsm_mux[i] = gsm; gsm 2132 drivers/tty/n_gsm.c dlci = gsm_dlci_alloc(gsm, 0); gsm 2135 drivers/tty/n_gsm.c gsm->dead = 0; /* Tty opens are now permissible */ gsm 2145 drivers/tty/n_gsm.c static void gsm_free_mux(struct gsm_mux *gsm) gsm 2147 drivers/tty/n_gsm.c kfree(gsm->txframe); gsm 2148 drivers/tty/n_gsm.c kfree(gsm->buf); gsm 2149 drivers/tty/n_gsm.c kfree(gsm); gsm 2160 drivers/tty/n_gsm.c struct gsm_mux *gsm = container_of(ref, struct gsm_mux, ref); gsm 2161 drivers/tty/n_gsm.c gsm_free_mux(gsm); gsm 2164 drivers/tty/n_gsm.c static inline void mux_get(struct gsm_mux *gsm) gsm 2166 drivers/tty/n_gsm.c kref_get(&gsm->ref); gsm 2169 drivers/tty/n_gsm.c static inline void mux_put(struct gsm_mux *gsm) gsm 2171 drivers/tty/n_gsm.c kref_put(&gsm->ref, gsm_free_muxr); gsm 2174 drivers/tty/n_gsm.c static inline unsigned int mux_num_to_base(struct gsm_mux *gsm) gsm 2176 drivers/tty/n_gsm.c return gsm->num * NUM_DLCI; gsm 2192 drivers/tty/n_gsm.c struct gsm_mux *gsm = kzalloc(sizeof(struct gsm_mux), GFP_KERNEL); gsm 2193 drivers/tty/n_gsm.c if (gsm == NULL) gsm 2195 drivers/tty/n_gsm.c gsm->buf = kmalloc(MAX_MRU + 1, GFP_KERNEL); gsm 2196 drivers/tty/n_gsm.c if (gsm->buf == NULL) { gsm 2197 drivers/tty/n_gsm.c kfree(gsm); gsm 2200 drivers/tty/n_gsm.c gsm->txframe = kmalloc(2 * MAX_MRU + 2, GFP_KERNEL); gsm 2201 drivers/tty/n_gsm.c if (gsm->txframe == NULL) { gsm 2202 drivers/tty/n_gsm.c kfree(gsm->buf); gsm 2203 drivers/tty/n_gsm.c kfree(gsm); gsm 2206 drivers/tty/n_gsm.c spin_lock_init(&gsm->lock); gsm 2207 drivers/tty/n_gsm.c mutex_init(&gsm->mutex); gsm 2208 drivers/tty/n_gsm.c kref_init(&gsm->ref); gsm 2209 drivers/tty/n_gsm.c INIT_LIST_HEAD(&gsm->tx_list); gsm 2211 drivers/tty/n_gsm.c gsm->t1 = T1; gsm 2212 drivers/tty/n_gsm.c gsm->t2 = T2; gsm 2213 drivers/tty/n_gsm.c gsm->n2 = N2; gsm 2214 drivers/tty/n_gsm.c gsm->ftype = UIH; gsm 2215 drivers/tty/n_gsm.c gsm->adaption = 1; gsm 2216 drivers/tty/n_gsm.c gsm->encoding = 1; gsm 2217 drivers/tty/n_gsm.c gsm->mru = 64; /* Default to encoding 1 so these should be 64 */ gsm 2218 drivers/tty/n_gsm.c gsm->mtu = 64; gsm 2219 drivers/tty/n_gsm.c gsm->dead = 1; /* Avoid early tty opens */ gsm 2221 drivers/tty/n_gsm.c return gsm; gsm 2224 drivers/tty/n_gsm.c static void gsm_copy_config_values(struct gsm_mux *gsm, gsm 2228 drivers/tty/n_gsm.c c->adaption = gsm->adaption; gsm 2229 drivers/tty/n_gsm.c c->encapsulation = gsm->encoding; gsm 2230 drivers/tty/n_gsm.c c->initiator = gsm->initiator; gsm 2231 drivers/tty/n_gsm.c c->t1 = gsm->t1; gsm 2232 drivers/tty/n_gsm.c c->t2 = gsm->t2; gsm 2234 drivers/tty/n_gsm.c c->n2 = gsm->n2; gsm 2235 drivers/tty/n_gsm.c if (gsm->ftype == UIH) gsm 2239 drivers/tty/n_gsm.c pr_debug("Ftype %d i %d\n", gsm->ftype, c->i); gsm 2240 drivers/tty/n_gsm.c c->mru = gsm->mru; gsm 2241 drivers/tty/n_gsm.c c->mtu = gsm->mtu; gsm 2245 drivers/tty/n_gsm.c static int gsm_config(struct gsm_mux *gsm, struct gsm_config *c) gsm 2269 drivers/tty/n_gsm.c if (c->t1 != 0 && c->t1 != gsm->t1) gsm 2271 drivers/tty/n_gsm.c if (c->t2 != 0 && c->t2 != gsm->t2) gsm 2273 drivers/tty/n_gsm.c if (c->encapsulation != gsm->encoding) gsm 2275 drivers/tty/n_gsm.c if (c->adaption != gsm->adaption) gsm 2278 drivers/tty/n_gsm.c if (c->initiator != gsm->initiator) gsm 2280 drivers/tty/n_gsm.c if (c->mru != gsm->mru) gsm 2282 drivers/tty/n_gsm.c if (c->mtu != gsm->mtu) gsm 2293 drivers/tty/n_gsm.c ret = gsm_disconnect(gsm); gsm 2299 drivers/tty/n_gsm.c gsm_cleanup_mux(gsm); gsm 2301 drivers/tty/n_gsm.c gsm->initiator = c->initiator; gsm 2302 drivers/tty/n_gsm.c gsm->mru = c->mru; gsm 2303 drivers/tty/n_gsm.c gsm->mtu = c->mtu; gsm 2304 drivers/tty/n_gsm.c gsm->encoding = c->encapsulation; gsm 2305 drivers/tty/n_gsm.c gsm->adaption = c->adaption; gsm 2306 drivers/tty/n_gsm.c gsm->n2 = c->n2; gsm 2309 drivers/tty/n_gsm.c gsm->ftype = UIH; gsm 2311 drivers/tty/n_gsm.c gsm->ftype = UI; gsm 2314 drivers/tty/n_gsm.c gsm->t1 = c->t1; gsm 2316 drivers/tty/n_gsm.c gsm->t2 = c->t2; gsm 2323 drivers/tty/n_gsm.c gsm_activate_mux(gsm); gsm 2324 drivers/tty/n_gsm.c if (gsm->initiator && need_close) gsm 2325 drivers/tty/n_gsm.c gsm_dlci_begin_open(gsm->dlci[0]); gsm 2339 drivers/tty/n_gsm.c static int gsmld_output(struct gsm_mux *gsm, u8 *data, int len) gsm 2341 drivers/tty/n_gsm.c if (tty_write_room(gsm->tty) < len) { gsm 2342 drivers/tty/n_gsm.c set_bit(TTY_DO_WRITE_WAKEUP, &gsm->tty->flags); gsm 2348 drivers/tty/n_gsm.c gsm->tty->ops->write(gsm->tty, data, len); gsm 2362 drivers/tty/n_gsm.c static int gsmld_attach_gsm(struct tty_struct *tty, struct gsm_mux *gsm) gsm 2367 drivers/tty/n_gsm.c gsm->tty = tty_kref_get(tty); gsm 2368 drivers/tty/n_gsm.c gsm->output = gsmld_output; gsm 2369 drivers/tty/n_gsm.c ret = gsm_activate_mux(gsm); gsm 2371 drivers/tty/n_gsm.c tty_kref_put(gsm->tty); gsm 2375 drivers/tty/n_gsm.c base = mux_num_to_base(gsm); /* Base for this MUX */ gsm 2391 drivers/tty/n_gsm.c static void gsmld_detach_gsm(struct tty_struct *tty, struct gsm_mux *gsm) gsm 2393 drivers/tty/n_gsm.c unsigned int base = mux_num_to_base(gsm); /* Base for this MUX */ gsm 2396 drivers/tty/n_gsm.c WARN_ON(tty != gsm->tty); gsm 2399 drivers/tty/n_gsm.c gsm_cleanup_mux(gsm); gsm 2400 drivers/tty/n_gsm.c tty_kref_put(gsm->tty); gsm 2401 drivers/tty/n_gsm.c gsm->tty = NULL; gsm 2407 drivers/tty/n_gsm.c struct gsm_mux *gsm = tty->disc_data; gsm 2422 drivers/tty/n_gsm.c gsm->receive(gsm, *dp); gsm 2428 drivers/tty/n_gsm.c gsm->error(gsm, *dp, flags); gsm 2465 drivers/tty/n_gsm.c struct gsm_mux *gsm = tty->disc_data; gsm 2467 drivers/tty/n_gsm.c gsmld_detach_gsm(tty, gsm); gsm 2471 drivers/tty/n_gsm.c mux_put(gsm); gsm 2486 drivers/tty/n_gsm.c struct gsm_mux *gsm; gsm 2493 drivers/tty/n_gsm.c gsm = gsm_alloc_mux(); gsm 2494 drivers/tty/n_gsm.c if (gsm == NULL) gsm 2497 drivers/tty/n_gsm.c tty->disc_data = gsm; gsm 2501 drivers/tty/n_gsm.c gsm->encoding = 1; gsm 2503 drivers/tty/n_gsm.c ret = gsmld_attach_gsm(tty, gsm); gsm 2505 drivers/tty/n_gsm.c gsm_cleanup_mux(gsm); gsm 2506 drivers/tty/n_gsm.c mux_put(gsm); gsm 2522 drivers/tty/n_gsm.c struct gsm_mux *gsm = tty->disc_data; gsm 2527 drivers/tty/n_gsm.c spin_lock_irqsave(&gsm->tx_lock, flags); gsm 2528 drivers/tty/n_gsm.c gsm_data_kick(gsm); gsm 2529 drivers/tty/n_gsm.c if (gsm->tx_bytes < TX_THRESH_LO) { gsm 2530 drivers/tty/n_gsm.c gsm_dlci_data_sweep(gsm); gsm 2532 drivers/tty/n_gsm.c spin_unlock_irqrestore(&gsm->tx_lock, flags); gsm 2598 drivers/tty/n_gsm.c struct gsm_mux *gsm = tty->disc_data; gsm 2606 drivers/tty/n_gsm.c if (gsm->dead) gsm 2615 drivers/tty/n_gsm.c struct gsm_mux *gsm = tty->disc_data; gsm 2620 drivers/tty/n_gsm.c gsm_copy_config_values(gsm, &c); gsm 2627 drivers/tty/n_gsm.c return gsm_config(gsm, &c); gsm 2629 drivers/tty/n_gsm.c base = mux_num_to_base(gsm); gsm 2812 drivers/tty/n_gsm.c net->mtu = dlci->gsm->mtu; gsm 2814 drivers/tty/n_gsm.c net->max_mtu = dlci->gsm->mtu; gsm 2873 drivers/tty/n_gsm.c ctrl = gsm_control_send(dlci->gsm, CMD_MSC, modembits, len + 1); gsm 2876 drivers/tty/n_gsm.c return gsm_control_wait(dlci->gsm, ctrl); gsm 2882 drivers/tty/n_gsm.c struct gsm_mux *gsm = dlci->gsm; gsm 2894 drivers/tty/n_gsm.c if (gsm->encoding == 0 && gsm->dlci[0]->mode == DLCI_MODE_ADM && gsm 2923 drivers/tty/n_gsm.c struct gsm_mux *gsm; gsm 2939 drivers/tty/n_gsm.c gsm = gsm_mux[mux]; gsm 2940 drivers/tty/n_gsm.c if (gsm->dead) gsm 2946 drivers/tty/n_gsm.c mutex_lock(&gsm->mutex); gsm 2947 drivers/tty/n_gsm.c if (gsm->dlci[0] && gsm->dlci[0]->state != DLCI_OPEN) { gsm 2948 drivers/tty/n_gsm.c mutex_unlock(&gsm->mutex); gsm 2951 drivers/tty/n_gsm.c dlci = gsm->dlci[line]; gsm 2954 drivers/tty/n_gsm.c dlci = gsm_dlci_alloc(gsm, line); gsm 2957 drivers/tty/n_gsm.c mutex_unlock(&gsm->mutex); gsm 2964 drivers/tty/n_gsm.c mutex_unlock(&gsm->mutex); gsm 2969 drivers/tty/n_gsm.c dlci_get(gsm->dlci[0]); gsm 2970 drivers/tty/n_gsm.c mux_get(gsm); gsm 2972 drivers/tty/n_gsm.c mutex_unlock(&gsm->mutex); gsm 3193 drivers/tty/n_gsm.c struct gsm_mux *gsm = dlci->gsm; gsm 3196 drivers/tty/n_gsm.c dlci_put(gsm->dlci[0]); gsm 3197 drivers/tty/n_gsm.c mux_put(gsm);