Lines Matching refs:hdlc
49 struct hdlc_device *hdlc; in hdlc_rcv() local
57 hdlc = dev_to_hdlc(dev); in hdlc_rcv()
64 BUG_ON(!hdlc->proto->netif_rx); in hdlc_rcv()
65 return hdlc->proto->netif_rx(skb); in hdlc_rcv()
70 hdlc_device *hdlc = dev_to_hdlc(dev); in hdlc_start_xmit() local
72 if (hdlc->proto->xmit) in hdlc_start_xmit()
73 return hdlc->proto->xmit(skb, dev); in hdlc_start_xmit()
75 return hdlc->xmit(skb, dev); /* call hardware driver directly */ in hdlc_start_xmit()
80 hdlc_device *hdlc = dev_to_hdlc(dev); in hdlc_proto_start() local
81 if (hdlc->proto->start) in hdlc_proto_start()
82 hdlc->proto->start(dev); in hdlc_proto_start()
89 hdlc_device *hdlc = dev_to_hdlc(dev); in hdlc_proto_stop() local
90 if (hdlc->proto->stop) in hdlc_proto_stop()
91 hdlc->proto->stop(dev); in hdlc_proto_stop()
100 hdlc_device *hdlc; in hdlc_device_event() local
120 hdlc = dev_to_hdlc(dev); in hdlc_device_event()
121 spin_lock_irqsave(&hdlc->state_lock, flags); in hdlc_device_event()
123 if (hdlc->carrier == on) in hdlc_device_event()
126 hdlc->carrier = on; in hdlc_device_event()
128 if (!hdlc->open) in hdlc_device_event()
131 if (hdlc->carrier) { in hdlc_device_event()
140 spin_unlock_irqrestore(&hdlc->state_lock, flags); in hdlc_device_event()
149 hdlc_device *hdlc = dev_to_hdlc(dev); in hdlc_open() local
152 hdlc->carrier, hdlc->open); in hdlc_open()
155 if (hdlc->proto == NULL) in hdlc_open()
158 if (hdlc->proto->open) { in hdlc_open()
159 int result = hdlc->proto->open(dev); in hdlc_open()
164 spin_lock_irq(&hdlc->state_lock); in hdlc_open()
166 if (hdlc->carrier) { in hdlc_open()
172 hdlc->open = 1; in hdlc_open()
174 spin_unlock_irq(&hdlc->state_lock); in hdlc_open()
183 hdlc_device *hdlc = dev_to_hdlc(dev); in hdlc_close() local
186 hdlc->carrier, hdlc->open); in hdlc_close()
189 spin_lock_irq(&hdlc->state_lock); in hdlc_close()
191 hdlc->open = 0; in hdlc_close()
192 if (hdlc->carrier) in hdlc_close()
195 spin_unlock_irq(&hdlc->state_lock); in hdlc_close()
197 if (hdlc->proto->close) in hdlc_close()
198 hdlc->proto->close(dev); in hdlc_close()
248 hdlc_device *hdlc = dev_to_hdlc(dev); in hdlc_setup() local
251 hdlc->carrier = 1; in hdlc_setup()
252 hdlc->open = 0; in hdlc_setup()
253 spin_lock_init(&hdlc->state_lock); in hdlc_setup()
303 hdlc_device *hdlc = dev_to_hdlc(dev); in detach_hdlc_protocol() local
306 if (hdlc->proto) { in detach_hdlc_protocol()
314 if (hdlc->proto->detach) in detach_hdlc_protocol()
315 hdlc->proto->detach(dev); in detach_hdlc_protocol()
316 module_put(hdlc->proto->module); in detach_hdlc_protocol()
317 hdlc->proto = NULL; in detach_hdlc_protocol()
319 kfree(hdlc->state); in detach_hdlc_protocol()
320 hdlc->state = NULL; in detach_hdlc_protocol()