• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/drivers/isdn/hysdn/

Lines Matching defs:cnf

54 process_line(struct conf_writedata *cnf)
56 unsigned char *cp = cnf->conf_line;
59 if (cnf->card->debug_flags & LOG_CNF_LINE)
60 hysdn_addlog(cnf->card, "conf line: %s", cp);
71 if (cnf->card->debug_flags & LOG_CNF_MISC)
72 hysdn_addlog(cnf->card, "conf channel invalid %d", i);
75 cnf->channel = i & 0xFFFF; /* set new channel number */
79 if (cnf->card->debug_flags & LOG_CNF_DATA)
80 hysdn_addlog(cnf->card, "conf chan=%d %s", cnf->channel, cp);
81 return (hysdn_tx_cfgline(cnf->card, cnf->conf_line + 1,
82 cnf->channel)); /* send the line without * */
97 struct conf_writedata *cnf;
104 if (!(cnf = file->private_data))
107 if (cnf->state == CONF_STATE_DETECT) { /* auto detect cnf or pof data */
113 if ((cnf->needed_size = pof_write_open(cnf->card, &cnf->pof_buffer)) <= 0)
114 return (cnf->needed_size); /* an error occurred -> exit */
115 cnf->buf_size = 0; /* buffer is empty */
116 cnf->state = CONF_STATE_POF; /* new state */
119 cnf->buf_size = 0; /* buffer is empty */
120 cnf->state = CONF_STATE_CONF; /* requested conf data write */
121 if (cnf->card->state != CARD_STATE_RUN)
123 cnf->conf_line[CONF_LINE_LEN - 1] = 0; /* limit string length */
124 cnf->channel = 4098; /* default channel for output */
127 if (cnf->state == CONF_STATE_POF) { /* pof write active */
128 i = cnf->needed_size - cnf->buf_size; /* bytes still missing for write */
134 if (copy_from_user(cnf->pof_buffer + cnf->buf_size, buf, count))
136 cnf->buf_size += count;
138 if (cnf->needed_size == cnf->buf_size) {
139 cnf->needed_size = pof_write_buffer(cnf->card, cnf->buf_size); /* write data */
140 if (cnf->needed_size <= 0) {
141 cnf->card->state = CARD_STATE_BOOTERR; /* show boot error */
142 return (cnf->needed_size); /* an error occurred */
144 cnf->buf_size = 0; /* buffer is empty again */
150 if (cnf->card->state != CARD_STATE_RUN) {
151 if (cnf->card->debug_flags & LOG_CNF_MISC)
152 hysdn_addlog(cnf->card, "cnf write denied -> not booted");
155 i = (CONF_LINE_LEN - 1) - cnf->buf_size; /* bytes available in buffer */
161 if (copy_from_user(cnf->conf_line + cnf->buf_size, buf, count))
165 cp = cnf->conf_line + cnf->buf_size;
183 cnf->buf_size = 0; /* buffer is empty after transfer */
184 if ((i = process_line(cnf)) < 0) /* handle the line */
189 cnf->buf_size += count; /* add chars to string */
190 if (cnf->buf_size >= CONF_LINE_LEN - 1) {
191 if (cnf->card->debug_flags & LOG_CNF_MISC)
192 hysdn_addlog(cnf->card, "cnf line too long %d chars pos %d", cnf->buf_size, count);
200 if (cnf->card->debug_flags & LOG_CNF_MISC)
201 hysdn_addlog(cnf->card, "cnf line too long");
234 struct conf_writedata *cnf;
258 if (!(cnf = kmalloc(sizeof(struct conf_writedata), GFP_KERNEL))) {
262 cnf->card = card;
263 cnf->buf_size = 0; /* nothing buffered */
264 cnf->state = CONF_STATE_DETECT; /* start auto detect */
265 filep->private_data = cnf;
319 struct conf_writedata *cnf;
344 cnf = filep->private_data;
346 if (cnf->state == CONF_STATE_POF)
347 retval = pof_write_close(cnf->card); /* close the pof write */