Lines Matching refs:hdlc
48 struct hdlc_device *hdlc; in hdlc_rcv() local
56 hdlc = dev_to_hdlc(dev); in hdlc_rcv()
63 BUG_ON(!hdlc->proto->netif_rx); in hdlc_rcv()
64 return hdlc->proto->netif_rx(skb); in hdlc_rcv()
69 hdlc_device *hdlc = dev_to_hdlc(dev); in hdlc_start_xmit() local
71 if (hdlc->proto->xmit) in hdlc_start_xmit()
72 return hdlc->proto->xmit(skb, dev); in hdlc_start_xmit()
74 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
82 if (hdlc->proto->start) in hdlc_proto_start()
83 hdlc->proto->start(dev); in hdlc_proto_start()
88 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()
98 hdlc_device *hdlc; in hdlc_device_event() local
118 hdlc = dev_to_hdlc(dev); in hdlc_device_event()
119 spin_lock_irqsave(&hdlc->state_lock, flags); in hdlc_device_event()
121 if (hdlc->carrier == on) in hdlc_device_event()
124 hdlc->carrier = on; in hdlc_device_event()
126 if (!hdlc->open) in hdlc_device_event()
129 if (hdlc->carrier) { in hdlc_device_event()
138 spin_unlock_irqrestore(&hdlc->state_lock, flags); in hdlc_device_event()
145 hdlc_device *hdlc = dev_to_hdlc(dev); in hdlc_open() local
148 hdlc->carrier, hdlc->open); in hdlc_open()
151 if (!hdlc->proto) in hdlc_open()
154 if (hdlc->proto->open) { in hdlc_open()
155 int result = hdlc->proto->open(dev); in hdlc_open()
161 spin_lock_irq(&hdlc->state_lock); in hdlc_open()
163 if (hdlc->carrier) { in hdlc_open()
170 hdlc->open = 1; in hdlc_open()
172 spin_unlock_irq(&hdlc->state_lock); in hdlc_open()
180 hdlc_device *hdlc = dev_to_hdlc(dev); in hdlc_close() local
183 hdlc->carrier, hdlc->open); in hdlc_close()
186 spin_lock_irq(&hdlc->state_lock); in hdlc_close()
188 hdlc->open = 0; in hdlc_close()
189 if (hdlc->carrier) in hdlc_close()
192 spin_unlock_irq(&hdlc->state_lock); in hdlc_close()
194 if (hdlc->proto->close) in hdlc_close()
195 hdlc->proto->close(dev); in hdlc_close()
243 hdlc_device *hdlc = dev_to_hdlc(dev); in hdlc_setup() local
246 hdlc->carrier = 1; in hdlc_setup()
247 hdlc->open = 0; in hdlc_setup()
248 spin_lock_init(&hdlc->state_lock); in hdlc_setup()
299 hdlc_device *hdlc = dev_to_hdlc(dev); in detach_hdlc_protocol() local
302 if (hdlc->proto) { in detach_hdlc_protocol()
310 if (hdlc->proto->detach) in detach_hdlc_protocol()
311 hdlc->proto->detach(dev); in detach_hdlc_protocol()
312 module_put(hdlc->proto->module); in detach_hdlc_protocol()
313 hdlc->proto = NULL; in detach_hdlc_protocol()
315 kfree(hdlc->state); in detach_hdlc_protocol()
316 hdlc->state = NULL; in detach_hdlc_protocol()