Lines Matching refs:data

91  *	Each block of data we have queued to go out is in the form of
100 unsigned int len; /* Length of data block (can be zero) */
101 unsigned char *data; /* Points into buffer but not at the start */
118 * Each active data link has a gsm_dlci structure associated which ties
153 void (*data)(struct gsm_dlci *dlci, const u8 *data, int len);
154 void (*prev_data)(struct gsm_dlci *dlci, const u8 *data, int len);
163 * DLCI 0 is used to pass control blocks out of band of the data
172 u8 *data; /* Data for the command in case we retransmit */
241 unsigned int tx_bytes; /* TX data outstanding */
244 struct list_head tx_list; /* Pending data packets */
371 static int gsmld_output(struct gsm_mux *gsm, u8 *data, int len);
376 * @c: Next data
390 * @c: buffer of data
425 * @data: buffer of data
426 * @dlen: length of data
429 * returns the processed data length.
431 static unsigned int gsm_read_ea_val(unsigned int *val, const u8 *data, int dlen)
437 if (gsm_read_ea(val, *data++))
444 * gsm_encode_modem - encode modem data bits
536 * @data: following data bytes
537 * @dlen: length of data
544 u8 control, const u8 *data, int dlen)
594 print_hex_dump_bytes("", DUMP_PREFIX_NONE, data, dlen);
638 * queueing logic as they should be transmitted ahead of data when
641 * FIXME: Lock versus data TX path
655 cbuf[3] = EA; /* Length of data = 0 */
715 * gsm_data_alloc - allocate data frame
721 * Allocate a new data buffer for sending frames with data. Space is left
733 m->data = m->buffer + HDR_LEN - 1; /* Allow for FCS */
759 if (gsm_read_ea_val(&cmd, msg->data + 2, msg->len - 2) < 1)
777 * the transmit queue. Ram more data into the pipe if we have any
794 len = gsm_stuff_frame(msg->data,
800 memcpy(gsm->txframe + 1 , msg->data, msg->len);
831 * @dlci: DLCI sending the data
834 * Add data to the transmit queue and try and get stuff moving
842 u8 *dp = msg->data;
860 *fcs = gsm_fcs_add_block(INIT_FCS, dp , msg->data - dp);
863 *fcs = gsm_fcs_add_block(*fcs, msg->data, msg->len);
867 msg->data, msg->len);
871 msg->len += (msg->data - dp) + 1;
872 msg->data = dp;
882 * @dlci: DLCI sending the data
885 * Add data to the transmit queue and try and get stuff moving
899 * gsm_dlci_data_output - try and push data out of a DLCI
901 * @dlci: the DLCI to pull data from
903 * Pull data from a DLCI and send it into the transmit queue if there
904 * is data. Keep to the MRU of the mux. This path handles the usual tty
905 * interface which is a byte stream with optional modem data.
916 /* for modem bits without break data */
923 /* MTU/MRU count only the data bits but watch adaption mode */
935 dp = msg->data;
940 * Always one byte as we never send inline break data
957 /* Bytes of data we used up */
962 * gsm_dlci_data_output_framed - try and push data out of a DLCI
964 * @dlci: the DLCI to pull data from
966 * Pull data from a DLCI and send it into the transmit queue if there
967 * is data. Keep to the MRU of the mux. This path handles framed data
995 /* MTU/MRU count only the data bits */
1017 dp = msg->data;
1024 memcpy(dp, dlci->skb->data, len);
1035 * gsm_dlci_data_sweep - look for data to send
1039 * data to send. We could do with optimising this scan a bit. We aim
1079 * Transmit data from this DLCI if the queue is empty. We can't rely on
1081 * new data ourselves in other cases.
1115 * @data: data to follow encoded info
1116 * @dlen: length of data
1121 static void gsm_control_reply(struct gsm_mux *gsm, int cmd, const u8 *data,
1128 msg->data[0] = (cmd & 0xFE) << 1 | EA; /* Clear C/R */
1129 msg->data[1] = (dlen << 1) | EA;
1130 memcpy(msg->data + 2, data, dlen);
1197 * @data: data following command
1206 static void gsm_control_modem(struct gsm_mux *gsm, const u8 *data, int clen)
1213 const u8 *dp = data;
1253 gsm_control_reply(gsm, CMD_MSC, data, clen);
1259 * @data: data bytes
1260 * @clen: data length
1267 static void gsm_control_rls(struct gsm_mux *gsm, const u8 *data, int clen)
1273 const u8 *dp = data;
1304 gsm_control_reply(gsm, CMD_RLS, data, clen);
1313 * @data: data beyond the command/length EAs
1322 const u8 *data, int clen)
1339 /* Modem wishes to test, reply with the data */
1340 gsm_control_reply(gsm, CMD_TEST, data, clen);
1343 /* Modem can accept data again */
1358 gsm_control_modem(gsm, data, clen);
1362 gsm_control_rls(gsm, data, clen);
1384 * @data: data beyond the command/length EA
1394 const u8 *data, int clen)
1430 msg->data[0] = (ctrl->cmd << 1) | CR | EA; /* command */
1431 msg->data[1] = (ctrl->len << 1) | EA;
1432 memcpy(msg->data + 2, ctrl->data, ctrl->len);
1474 * @data: bytes of data (must be kmalloced)
1483 unsigned int command, u8 *data, int clen)
1498 ctrl->data = data;
1558 /* Prevent us from sending data before the link is up again */
1709 * gsm_dlci_data - data arrived
1711 * @data: block of bytes received
1714 * A UI or UIH frame has arrived which contains data for a channel
1719 static void gsm_dlci_data(struct gsm_dlci *dlci, const u8 *data, int clen)
1731 case 4: /* Packetised interruptible data */
1733 case 3: /* Packetised uininterruptible voice/data */
1736 while (gsm_read_ea(&modem, *data++) == 0) {
1749 tty_insert_flip_string(port, data, len);
1755 * gsm_dlci_control - data arrived on control channel
1757 * @data: block of bytes received
1760 * A UI or UIH frame has arrived which contains data for DLCI 0 the
1762 * control data bytes. The command EA contains a command/response bit
1766 static void gsm_dlci_command(struct gsm_dlci *dlci, const u8 *data, int len)
1771 if (gsm_read_ea(&command, *data++) == 1) {
1772 int clen = *data++;
1781 data, clen);
1784 data, clen);
1825 dlci->data = gsm_dlci_data;
1826 /* Prevent us from sending data before the link is up */
1829 dlci->data = gsm_dlci_command;
1909 * The fcs holds the header FCS but any data FCS must be added here.
1925 In this case it contain the last piece of data
2008 dlci->data(dlci, gsm->buf, gsm->len);
2022 * @gsm: gsm data for this ldisc instance
2107 * @gsm: gsm data for this ldisc instance
2126 /* EOF is only valid in frame if we have got to the data state
2195 * @gsm: ldisc data
2196 * @data: byte received (may be invalid)
2199 * Handle an error in the receipt of data for a frame. Currently we just
2206 unsigned char data, unsigned char flag)
2521 * @data: bytes to output
2524 * Write a block of data from the GSM mux to the data channel. This
2528 static int gsmld_output(struct gsm_mux *gsm, u8 *data, int len)
2536 data, len);
2537 gsm->tty->ops->write(gsm->tty, data, len);
2670 /* Attach our ldisc data */
2742 * itself (or some other control data). The data is transferred
2777 * Called when the line discipline is asked to poll() for data or
2855 dlci->data = dlci->prev_data;
3016 dlci->prev_data = dlci->data;
3018 dlci->data = gsm_mux_rx_netchar;
3259 then the data being transmitted can't simply be junked once