Lines Matching refs:fr
86 struct fr_data *fr = ch->LINE_privdata; in fr_keepalive_send() local
99 fr_packet[0] = (fr->dlci & (1024 - 15)) >> 2; in fr_keepalive_send()
100 fr_packet[1] = (fr->dlci & 15) << 4 | 1; // EA bit 1 in fr_keepalive_send()
110 fr_packet[11] = ++fr->local_cnt; in fr_keepalive_send()
111 fr_packet[12] = fr->remote_cnt; in fr_keepalive_send()
122 struct fr_data *fr = ch->LINE_privdata; in fr_keepalive_timerfun() local
129 if (fr->keepalivecnt == MAXALIVECNT) { in fr_keepalive_timerfun()
148 if (fr->keepalivecnt <= MAXALIVECNT) { in fr_keepalive_timerfun()
149 ++fr->keepalivecnt; in fr_keepalive_timerfun()
153 mod_timer(&fr->keepa_timer, jiffies + HZ * fr->keepa_freq); in fr_keepalive_timerfun()
160 struct fr_data *fr = ch->LINE_privdata; in fr_rx_lmi() local
166 if (dlci != fr->dlci || nlpid != NLPID_Q933_LMI || !fr->keepa_freq) { in fr_rx_lmi()
170 fr->remote_cnt = skb->data[7]; in fr_rx_lmi()
171 if (skb->data[8] == fr->local_cnt) { // keepalive UP! in fr_rx_lmi()
172 fr->keepalivecnt = 0; in fr_rx_lmi()
199 struct fr_data *fr = ch->LINE_privdata; in fr_set_keepalive() local
201 if (!keepa && fr->keepa_freq) { // switch off in fr_set_keepalive()
202 fr->keepa_freq = 0; in fr_set_keepalive()
206 del_timer(&fr->keepa_timer); in fr_set_keepalive()
212 if(fr->keepa_freq && (ch->line_status & LINE_UP)) { in fr_set_keepalive()
213 del_timer(&fr->keepa_timer); in fr_set_keepalive()
215 fr->keepa_freq = keepa; in fr_set_keepalive()
216 fr->local_cnt = fr->remote_cnt = 0; in fr_set_keepalive()
217 fr->keepa_timer.expires = jiffies + HZ; in fr_set_keepalive()
218 fr->keepa_timer.function = fr_keepalive_timerfun; in fr_set_keepalive()
219 fr->keepa_timer.data = (unsigned long)dev; in fr_set_keepalive()
224 add_timer(&fr->keepa_timer); in fr_set_keepalive()
327 struct fr_data *fr = ch->LINE_privdata; in fr_status() local
334 if (!fr->keepa_freq) { in fr_status()
341 if (dev == fr->master && fr->keepa_freq) { in fr_status()
343 fr->keepa_timer.expires = jiffies + HZ; in fr_status()
344 add_timer(&fr->keepa_timer); in fr_status()
345 fr->keepalivecnt = MAXALIVECNT + 1; in fr_status()
346 fr->keeploopcnt = 0; in fr_status()
348 del_timer(&fr->keepa_timer); in fr_status()
377 struct fr_data *fr = ch->LINE_privdata; in fr_open() local
391 if (!fr->master) { in fr_open()
394 mch = fr->master->priv; in fr_open()
395 if (fr->master != dev && (!(mch->init_status & LINE_OPEN) in fr_open()
398 "unable to open %s\n", fr->master->name, dev->name); in fr_open()
406 if (fr->master == dev) { in fr_open()
407 if (fr->keepa_freq) { in fr_open()
408 fr->keepa_timer.function = fr_keepalive_timerfun; in fr_open()
409 fr->keepa_timer.data = (unsigned long)dev; in fr_open()
410 add_timer(&fr->keepa_timer); in fr_open()
419 if(fr->master->flags & IFF_RUNNING) { in fr_open()
438 struct fr_data *fr = ch->LINE_privdata; in fr_close() local
441 if (fr->master == dev) { // Ha master in fr_close()
451 if (fr->keepa_freq) { in fr_close()
452 del_timer(&fr->keepa_timer); in fr_close()
488 struct fr_data *fr = ch->LINE_privdata; in fr_xmit() local
493 if (!fr->master) { in fr_xmit()
498 mch = fr->master->priv; in fr_xmit()
505 if (dev != fr->master) { in fr_xmit()
509 newskb->dev=fr->master; in fr_xmit()
547 struct fr_data *fr = ch->LINE_privdata; in fr_header() local
551 skb->data[0] = (fr->dlci & (1024 - 15)) >> 2; in fr_header()
552 skb->data[1] = (fr->dlci & 15) << 4 | 1; // EA bit 1 in fr_header()
562 struct fr_data *fr = ch->LINE_privdata; in fr_statistics() local
565 if (fr->master == dev) { in fr_statistics()
587 if (fr->keepa_freq) { in fr_statistics()
589 "status %s [%d]\n", fr->keepa_freq, in fr_statistics()
592 fr->keepalivecnt); in fr_statistics()
600 fr->master ? fr->master->name : "(not set)"); in fr_statistics()
611 struct fr_data *fr = NULL; in fr_read_proc() local
615 fr = ch->LINE_privdata; in fr_read_proc()
619 len = sprintf(page, "%04d\n", fr->dlci); in fr_read_proc()
621 len = sprintf(page, "%-9s\n", fr->master ? fr->master->name : in fr_read_proc()
624 len = fr->keepa_freq ? sprintf(page, "% 3d\n", fr->keepa_freq) in fr_read_proc()
647 struct fr_data *fr = NULL; in fr_write_proc() local
651 fr = ch->LINE_privdata; in fr_write_proc()
669 else fr->dlci = dlci_new; in fr_write_proc()
678 if(fr->master) in fr_write_proc()
679 dev_put(fr->master); in fr_write_proc()
680 fr->master = new_master; in fr_write_proc()
697 if (fr->keepa_freq && keepa_new != fr->keepa_freq) { in fr_write_proc()
717 struct fr_data *fr = ch->LINE_privdata; in fr_exit() local
724 if (fr->master && fr->master == dev) { in fr_exit()
754 if (fr->master != dev) { // if not master, remove dlci in fr_exit()
755 if(fr->master) in fr_exit()
756 dev_put(fr->master); in fr_exit()
760 if (fr->keepa_freq) { in fr_exit()
767 kfree(fr); in fr_exit()
777 struct fr_data *fr; in fr_master_init() local
780 if ((fr = ch->LINE_privdata = kmalloc(sizeof(struct fr_data), in fr_master_init()
784 memset(fr, 0, sizeof(struct fr_data)); in fr_master_init()
785 fr->master = dev; // this means master in fr_master_init()
786 fr->dlci = 0; // let's say default in fr_master_init()
831 kfree(fr); in fr_master_init()
838 struct fr_data *fr; in fr_slave_init() local
841 if ((fr = ch->LINE_privdata = kmalloc(sizeof(struct fr_data), in fr_slave_init()
845 memset(fr, 0, sizeof(struct fr_data)); in fr_slave_init()
888 kfree(fr); in fr_slave_init()
915 struct fr_data *fr = ch->LINE_privdata; in dlci_txe() local
917 if (!fr->master) { in dlci_txe()
921 ch = fr->master->priv; in dlci_txe()
922 fr = ch->LINE_privdata; in dlci_txe()
923 return ch->HW_txe(fr->master); in dlci_txe()