Lines Matching refs:hdlc
60 struct hdlc_device *hdlc = dev_to_hdlc(dev); in hdlc_rcv() local
67 BUG_ON(!hdlc->proto->netif_rx); in hdlc_rcv()
68 return hdlc->proto->netif_rx(skb); in hdlc_rcv()
73 hdlc_device *hdlc = dev_to_hdlc(dev); in hdlc_start_xmit() local
75 if (hdlc->proto->xmit) in hdlc_start_xmit()
76 return hdlc->proto->xmit(skb, dev); in hdlc_start_xmit()
78 return hdlc->xmit(skb, dev); /* call hardware driver directly */ in hdlc_start_xmit()
83 hdlc_device *hdlc = dev_to_hdlc(dev); in hdlc_proto_start() local
84 if (hdlc->proto->start) in hdlc_proto_start()
85 hdlc->proto->start(dev); in hdlc_proto_start()
92 hdlc_device *hdlc = dev_to_hdlc(dev); in hdlc_proto_stop() local
93 if (hdlc->proto->stop) in hdlc_proto_stop()
94 hdlc->proto->stop(dev); in hdlc_proto_stop()
103 hdlc_device *hdlc; in hdlc_device_event() local
123 hdlc = dev_to_hdlc(dev); in hdlc_device_event()
124 spin_lock_irqsave(&hdlc->state_lock, flags); in hdlc_device_event()
126 if (hdlc->carrier == on) in hdlc_device_event()
129 hdlc->carrier = on; in hdlc_device_event()
131 if (!hdlc->open) in hdlc_device_event()
134 if (hdlc->carrier) { in hdlc_device_event()
143 spin_unlock_irqrestore(&hdlc->state_lock, flags); in hdlc_device_event()
152 hdlc_device *hdlc = dev_to_hdlc(dev); in hdlc_open() local
155 hdlc->carrier, hdlc->open); in hdlc_open()
158 if (hdlc->proto == NULL) in hdlc_open()
161 if (hdlc->proto->open) { in hdlc_open()
162 int result = hdlc->proto->open(dev); in hdlc_open()
167 spin_lock_irq(&hdlc->state_lock); in hdlc_open()
169 if (hdlc->carrier) { in hdlc_open()
175 hdlc->open = 1; in hdlc_open()
177 spin_unlock_irq(&hdlc->state_lock); in hdlc_open()
186 hdlc_device *hdlc = dev_to_hdlc(dev); in hdlc_close() local
189 hdlc->carrier, hdlc->open); in hdlc_close()
192 spin_lock_irq(&hdlc->state_lock); in hdlc_close()
194 hdlc->open = 0; in hdlc_close()
195 if (hdlc->carrier) in hdlc_close()
198 spin_unlock_irq(&hdlc->state_lock); in hdlc_close()
200 if (hdlc->proto->close) in hdlc_close()
201 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()
298 hdlc_device *hdlc = dev_to_hdlc(dev); in detach_hdlc_protocol() local
300 if (hdlc->proto) { in detach_hdlc_protocol()
301 if (hdlc->proto->detach) in detach_hdlc_protocol()
302 hdlc->proto->detach(dev); in detach_hdlc_protocol()
303 module_put(hdlc->proto->module); in detach_hdlc_protocol()
304 hdlc->proto = NULL; in detach_hdlc_protocol()
306 kfree(hdlc->state); in detach_hdlc_protocol()
307 hdlc->state = NULL; in detach_hdlc_protocol()